mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-09-05 06:14:59 +00:00
DX: fix phstan & cs
This commit is contained in:
@@ -12,14 +12,19 @@ declare(strict_types=1);
|
||||
namespace Chill\PersonBundle\Templating\Entity;
|
||||
|
||||
use Chill\MainBundle\Templating\Entity\AbstractChillEntityRender;
|
||||
use Chill\MainBundle\Templating\Entity\BoxUtilsChillEntityRenderTrait;
|
||||
use Chill\MainBundle\Templating\Entity\ChillEntityRenderInterface;
|
||||
use Chill\MainBundle\Templating\TranslatableStringHelper;
|
||||
use Chill\PersonBundle\Entity\AccompanyingPeriod\ClosingMotive;
|
||||
|
||||
/**
|
||||
* Render closing motive.
|
||||
*
|
||||
* @implements ChillEntityRenderInterface<ClosingMotive>
|
||||
*/
|
||||
class ClosingMotiveRender extends AbstractChillEntityRender
|
||||
class ClosingMotiveRender implements ChillEntityRenderInterface
|
||||
{
|
||||
use BoxUtilsChillEntityRenderTrait;
|
||||
private const SEPARATOR = ' > ';
|
||||
|
||||
/**
|
||||
@@ -40,9 +45,6 @@ class ClosingMotiveRender extends AbstractChillEntityRender
|
||||
$this->getDefaultClosingBox();
|
||||
}
|
||||
|
||||
/**
|
||||
* @param ClosingMotive $entity
|
||||
*/
|
||||
public function renderString($entity, array $options): string
|
||||
{
|
||||
return $this->renderStringRecursive(
|
||||
@@ -57,12 +59,12 @@ class ClosingMotiveRender extends AbstractChillEntityRender
|
||||
return $entity instanceof ClosingMotive;
|
||||
}
|
||||
|
||||
protected function renderStringRecursive(ClosingMotive $motive, $existing, array $options)
|
||||
private function renderStringRecursive(ClosingMotive $motive, string $existing, array $options)
|
||||
{
|
||||
$newExisting = $this->translatableStringHelper->localize($motive->getName());
|
||||
|
||||
if ($motive->hasParent()) {
|
||||
if (!empty($existing)) {
|
||||
if ('' !== $existing) {
|
||||
$newExisting = $newExisting . self::SEPARATOR . $existing;
|
||||
}
|
||||
|
||||
@@ -73,7 +75,7 @@ class ClosingMotiveRender extends AbstractChillEntityRender
|
||||
);
|
||||
}
|
||||
|
||||
if (!empty($existing)) {
|
||||
if ('' !== $existing) {
|
||||
return $newExisting . self::SEPARATOR . $existing;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user