From 714a400bd8427249fdc523022fa3bd302e98dd1a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9=20H=C3=A4hnel?= Date: Thu, 7 Nov 2024 12:34:43 +0100 Subject: [PATCH] Add filter config --- src/Bridge/Laminas/ConfigProvider.php | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/src/Bridge/Laminas/ConfigProvider.php b/src/Bridge/Laminas/ConfigProvider.php index 821445b..cd75ade 100644 --- a/src/Bridge/Laminas/ConfigProvider.php +++ b/src/Bridge/Laminas/ConfigProvider.php @@ -3,6 +3,7 @@ namespace Cocur\Slugify\Bridge\Laminas; use Cocur\Slugify\Slugify; +use Laminas\ServiceManager\Factory\InvokableFactory; class ConfigProvider { @@ -15,6 +16,7 @@ public function __invoke(): array { return [ 'dependencies' => $this->getDependencyConfig(), + 'filters' => $this->filterConfig(), 'view_helpers' => $this->getViewHelperConfig(), ]; } @@ -52,4 +54,19 @@ public function getViewHelperConfig(): array ] ]; } + + /** + * @return array + */ + private function filterConfig(): array + { + return [ + 'factories' => [ + SlugifyFilter::class => InvokableFactory::class, + ], + 'aliases' => [ + 'slugify' => SlugifyFilter::class, + ], + ]; + } }