<?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)
            ),
        ];
    }
}
