mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-09-24 23:55:02 +00:00
32 lines
809 B
PHP
32 lines
809 B
PHP
<?php
|
|
|
|
declare(strict_types=1);
|
|
|
|
/*
|
|
* Chill is a software for social workers
|
|
*
|
|
* For the full copyright and license information, please view
|
|
* the LICENSE file that was distributed with this source code.
|
|
*/
|
|
|
|
namespace Chill\PersonBundle\PersonIdentifier\Rendering;
|
|
|
|
use Chill\PersonBundle\Entity\Person;
|
|
use Twig\Extension\AbstractExtension;
|
|
use Twig\TwigFilter;
|
|
|
|
final class PersonIdRenderingTwigExtension extends AbstractExtension
|
|
{
|
|
public function __construct(private readonly PersonIdRenderingInterface $personIdRendering) {}
|
|
|
|
public function getFilters(): array
|
|
{
|
|
return [
|
|
new TwigFilter(
|
|
'chill_person_id_render_text',
|
|
fn (Person $person): string => $this->personIdRendering->renderPersonId($person)
|
|
),
|
|
];
|
|
}
|
|
}
|