From 40455fbb0533e6888cb32cab1246cba22f669f7a Mon Sep 17 00:00:00 2001 From: Aleksey Polyvanyi Date: Tue, 3 Sep 2024 10:33:01 +0200 Subject: [PATCH] feature/easy-monorepo-autoconfigure-services --- packages/EasyApiPlatform/bundle/config/filters.php | 3 +++ .../EasyEventDispatcher/bundle/config/services.php | 11 +++++++---- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/packages/EasyApiPlatform/bundle/config/filters.php b/packages/EasyApiPlatform/bundle/config/filters.php index b9155cc43..f65b21231 100644 --- a/packages/EasyApiPlatform/bundle/config/filters.php +++ b/packages/EasyApiPlatform/bundle/config/filters.php @@ -8,6 +8,9 @@ return static function (ContainerConfigurator $containerConfigurator): void { $services = $containerConfigurator->services(); + $services->defaults() + ->autowire() + ->autoconfigure(); $services->set('eonx.api_platform.doctrine.orm.advanced_search_filter', AdvancedSearchFilter::class) ->autoconfigure(false) diff --git a/packages/EasyEventDispatcher/bundle/config/services.php b/packages/EasyEventDispatcher/bundle/config/services.php index bda575ca9..f23e85b6d 100644 --- a/packages/EasyEventDispatcher/bundle/config/services.php +++ b/packages/EasyEventDispatcher/bundle/config/services.php @@ -7,9 +7,12 @@ use EonX\EasyEventDispatcher\Dispatcher\EventDispatcherInterface; use Symfony\Contracts\EventDispatcher\EventDispatcherInterface as SymfonyEventDispatcherInterface; -return static function (ContainerConfigurator $container): void { - $container - ->services() - ->set(EventDispatcherInterface::class, EventDispatcher::class) +return static function (ContainerConfigurator $containerConfigurator): void { + $services = $containerConfigurator->services(); + $services->defaults() + ->autowire() + ->autoconfigure(); + + $services->set(EventDispatcherInterface::class, EventDispatcher::class) ->args([service(SymfonyEventDispatcherInterface::class)]); };