diff --git a/src/Bundle/ChillCustomFieldsBundle/Controller/CustomFieldsGroupController.php b/src/Bundle/ChillCustomFieldsBundle/Controller/CustomFieldsGroupController.php index 08f41d565..dcb22e9c8 100644 --- a/src/Bundle/ChillCustomFieldsBundle/Controller/CustomFieldsGroupController.php +++ b/src/Bundle/ChillCustomFieldsBundle/Controller/CustomFieldsGroupController.php @@ -237,7 +237,7 @@ class CustomFieldsGroupController extends AbstractController ]); } - private function createCreateFieldForm(CustomFieldsGroup $customFieldsGroup) + private function createCreateFieldForm(CustomFieldsGroup $customFieldsGroup): \Symfony\Component\Form\FormInterface { $fieldChoices = []; diff --git a/src/Bundle/ChillEventBundle/Search/EventSearch.php b/src/Bundle/ChillEventBundle/Search/EventSearch.php index 495eeea7f..10e034aed 100644 --- a/src/Bundle/ChillEventBundle/Search/EventSearch.php +++ b/src/Bundle/ChillEventBundle/Search/EventSearch.php @@ -177,7 +177,7 @@ class EventSearch extends AbstractSearch return $qb; } - protected function count(array $terms) + protected function count(array $terms): mixed { $qb = $this->eventRepository->createQueryBuilder('e'); $qb->select('COUNT(e)'); @@ -191,7 +191,7 @@ class EventSearch extends AbstractSearch return ['date-from', 'date-to', 'name', 'date']; } - protected function search(array $terms, $start, $limit, $options) + protected function search(array $terms, $start, $limit, $options): mixed { $qb = $this->eventRepository->createQueryBuilder('e'); $qb->select('e'); diff --git a/src/Bundle/ChillMainBundle/Controller/SearchController.php b/src/Bundle/ChillMainBundle/Controller/SearchController.php index 76cb13137..8b48a468e 100644 --- a/src/Bundle/ChillMainBundle/Controller/SearchController.php +++ b/src/Bundle/ChillMainBundle/Controller/SearchController.php @@ -207,7 +207,7 @@ class SearchController extends AbstractController return $this->json($collection, \Symfony\Component\HttpFoundation\Response::HTTP_OK, [], ['groups' => ['read']]); } - protected function createAdvancedSearchForm($name, array $data = []) + protected function createAdvancedSearchForm($name, array $data = []): \Symfony\Component\Form\FormInterface { $builder = $this->formFactory ->createNamedBuilder( diff --git a/src/Bundle/ChillMainBundle/Export/Formatter/CSVFormatter.php b/src/Bundle/ChillMainBundle/Export/Formatter/CSVFormatter.php index 9535c6533..248b1d11d 100644 --- a/src/Bundle/ChillMainBundle/Export/Formatter/CSVFormatter.php +++ b/src/Bundle/ChillMainBundle/Export/Formatter/CSVFormatter.php @@ -313,12 +313,12 @@ class CSVFormatter implements FormatterInterface return $text; } - protected function getColumnHeaders() + protected function getColumnHeaders(): array { return $this->getPositionnalHeaders('c'); } - protected function getRowHeaders() + protected function getRowHeaders(): array { return $this->getPositionnalHeaders('r'); } diff --git a/src/Bundle/ChillMainBundle/Templating/ChillTwigRoutingHelper.php b/src/Bundle/ChillMainBundle/Templating/ChillTwigRoutingHelper.php index bfc5af09b..588c77838 100644 --- a/src/Bundle/ChillMainBundle/Templating/ChillTwigRoutingHelper.php +++ b/src/Bundle/ChillMainBundle/Templating/ChillTwigRoutingHelper.php @@ -23,7 +23,7 @@ use Twig\TwigFunction; * * The logic of the function is based on the original routing extension. */ -class ChillTwigRoutingHelper extends AbstractExtension +class ChillTwigRoutingHelper { /** * @var RoutingExtension @@ -75,6 +75,7 @@ class ChillTwigRoutingHelper extends AbstractExtension return $this->originalExtension->getPath($name, $params, $relative); } + #[\Twig\Attribute\AsTwigFilter('chill_return_path_label')] public function getLabelReturnPath($default) { $request = $this->requestStack->getCurrentRequest(); @@ -150,11 +151,4 @@ class ChillTwigRoutingHelper extends AbstractExtension { return $this->originalExtension->isUrlGenerationSafe($argsNode); } - - public function getFilters(): array - { - return [ - new TwigFilter('chill_return_path_label', $this->getLabelReturnPath(...)), - ]; - } }