<?php
declare(strict_types = 1);
namespace App\Action;
use App\Infra\Services\FilterApiService;
use App\Responder\RedirectResponder;
use App\Responder\TemplateResponder;
use Symfony\Component\Routing\Annotation\Route;
class ReferenceAction extends AbstractAction
{
public function __construct(
TemplateResponder $templateResponder,
RedirectResponder $redirectResponder,
FilterApiService $filterApiService
)
{
$this->templateResponder = $templateResponder;
$this->redirectResponder = $redirectResponder;
$this->filterApiService = $filterApiService;
}
/**
* @Route("/references", name="reference")
*/
public function __invoke()
{
$references = $this->filterApiService->getReferences();
return $this->templateResponder->__invoke('reference.html.twig', [
'references' => $references
]);
}
}