1
0

Code styling

This commit is contained in:
Richard Dern 2024-04-24 14:20:20 +02:00
parent 78fdaa6485
commit 657e098089

View File

@ -104,6 +104,23 @@ public function getParent(): ?Bundle
return $this->parent;
}
public function getArticleTitle(): string
{
return $this->metadata()->get('title') ?? Str::title(basename($this->path));
}
public function getSiteTitle(): string
{
$title = $this->getArticleTitle();
$section = $this->getSection();
if (!empty($section) && $section->getPath() !== $this->getPath()) {
$title .= ' - ' . $section->getArticleTitle();
}
return $title;
}
/**
* Return a boolean value indicating if there already is a bundle in
* specified path
@ -146,23 +163,6 @@ public function repair(): void
$this->save();
}
public function getArticleTitle(): string
{
return $this->metadata()->get('title') ?? Str::title(basename($this->path));
}
public function getSiteTitle(): string
{
$title = $this->getArticleTitle();
$section = $this->getSection();
if (!empty($section) && $section->getPath() !== $this->getPath()) {
$title .= ' - ' . $section->getArticleTitle();
}
return $title;
}
public function render()
{
$renderer = BundleRenderer::getBundleRendererFor($this);