From f98c7447873eaab9c61a040b4abb96b2708486a4 Mon Sep 17 00:00:00 2001 From: Damien Alexandre Date: Mon, 11 Jul 2022 23:07:17 +0200 Subject: [PATCH] Add array typehint on Twig Extensions (#208) Thanks for that ! --- src/Twig/AdminAuthorizationExtension.php | 4 ++-- src/Twig/CheckboxTreeExtension.php | 2 +- src/Twig/EmbeddedListExtension.php | 4 ++-- src/Twig/ListFormFiltersExtension.php | 2 +- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/Twig/AdminAuthorizationExtension.php b/src/Twig/AdminAuthorizationExtension.php index 5d4b8dc..fedfda6 100644 --- a/src/Twig/AdminAuthorizationExtension.php +++ b/src/Twig/AdminAuthorizationExtension.php @@ -18,14 +18,14 @@ public function __construct($adminAuthorizationChecker) $this->adminAuthorizationChecker = $adminAuthorizationChecker; } - public function getFilters() + public function getFilters(): array { return [ new TwigFilter('prune_item_actions', [$this, 'pruneItemsActions']), ]; } - public function getFunctions() + public function getFunctions(): array { return [ new TwigFunction('is_easyadmin_granted', [$this, 'isEasyAdminGranted']), diff --git a/src/Twig/CheckboxTreeExtension.php b/src/Twig/CheckboxTreeExtension.php index 04c00db..8b37637 100644 --- a/src/Twig/CheckboxTreeExtension.php +++ b/src/Twig/CheckboxTreeExtension.php @@ -9,7 +9,7 @@ class CheckboxTreeExtension extends AbstractExtension { - public function getFunctions() + public function getFunctions(): array { return [ new TwigFunction( diff --git a/src/Twig/EmbeddedListExtension.php b/src/Twig/EmbeddedListExtension.php index 453d5de..49e452b 100644 --- a/src/Twig/EmbeddedListExtension.php +++ b/src/Twig/EmbeddedListExtension.php @@ -23,14 +23,14 @@ public function __construct($embeddedListHelper) $this->embeddedListHelper = $embeddedListHelper; } - public function getFilters() + public function getFilters(): array { return [ new TwigFilter('embedded_list_identifier', [$this, 'getEmbeddedListIdentifier']), ]; } - public function getFunctions() + public function getFunctions(): array { return [ new TwigFunction('guess_default_filters', [$this, 'guessDefaultFilters']), diff --git a/src/Twig/ListFormFiltersExtension.php b/src/Twig/ListFormFiltersExtension.php index a2b48c7..82550cb 100644 --- a/src/Twig/ListFormFiltersExtension.php +++ b/src/Twig/ListFormFiltersExtension.php @@ -22,7 +22,7 @@ public function __construct($listFormFiltersHelper) $this->listFormFiltersHelper = $listFormFiltersHelper; } - public function getFunctions() + public function getFunctions(): array { return [ new TwigFunction('list_form_filters', [$this, 'getListFormFilters']),