DX: fix phstan & cs

This commit is contained in:
2023-03-05 17:43:44 +01:00
parent 4dbb195b45
commit 8695099819
25 changed files with 119 additions and 349 deletions

View File

@@ -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;
}