From 59b322ee8ec43f61fc89cbb1abdb51a8e113f689 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Julien=20Fastr=C3=A9?= Date: Wed, 28 Jan 2026 16:19:54 +0100 Subject: [PATCH] Register `SubjectConverterInterface` for autoconfiguration and add new audit services - Registered `SubjectConverterInterface` for autoconfiguration with the `chill_main.audit_subject_converter` tag. - Added `audit.yaml` to configure audit-related services and enable service discovery for the `Audit` namespace. - Updated `services.yaml` to include the new `audit.yaml` configuration. --- src/Bundle/ChillMainBundle/ChillMainBundle.php | 3 +++ src/Bundle/ChillMainBundle/config/services.yaml | 1 + .../ChillMainBundle/config/services/audit.yaml | 16 ++++++++++++++++ 3 files changed, 20 insertions(+) create mode 100644 src/Bundle/ChillMainBundle/config/services/audit.yaml diff --git a/src/Bundle/ChillMainBundle/ChillMainBundle.php b/src/Bundle/ChillMainBundle/ChillMainBundle.php index 4a059662c..a3222a685 100644 --- a/src/Bundle/ChillMainBundle/ChillMainBundle.php +++ b/src/Bundle/ChillMainBundle/ChillMainBundle.php @@ -11,6 +11,7 @@ declare(strict_types=1); namespace Chill\MainBundle; +use Chill\MainBundle\Audit\SubjectConverterInterface; use Chill\MainBundle\Cron\CronJobInterface; use Chill\MainBundle\CRUD\CompilerPass\CRUDControllerCompilerPass; use Chill\MainBundle\DependencyInjection\CompilerPass\ACLFlagsCompilerPass; @@ -64,6 +65,8 @@ class ChillMainBundle extends Bundle ->addTag('chill_main.provide_role'); $container->registerForAutoconfiguration(NotificationFlagProviderInterface::class) ->addTag('chill_main.notification_flag_provider'); + $container->registerForAutoconfiguration(SubjectConverterInterface::class) + ->addTag('chill_main.audit_subject_converter'); $container->addCompilerPass(new SearchableServicesCompilerPass(), \Symfony\Component\DependencyInjection\Compiler\PassConfig::TYPE_BEFORE_OPTIMIZATION, 0); $container->addCompilerPass(new ConfigConsistencyCompilerPass(), \Symfony\Component\DependencyInjection\Compiler\PassConfig::TYPE_BEFORE_OPTIMIZATION, 0); diff --git a/src/Bundle/ChillMainBundle/config/services.yaml b/src/Bundle/ChillMainBundle/config/services.yaml index f73eeb071..b8c0fbd10 100644 --- a/src/Bundle/ChillMainBundle/config/services.yaml +++ b/src/Bundle/ChillMainBundle/config/services.yaml @@ -3,6 +3,7 @@ parameters: imports: - ./services/clock.yaml + - ./services/audit.yaml services: _defaults: diff --git a/src/Bundle/ChillMainBundle/config/services/audit.yaml b/src/Bundle/ChillMainBundle/config/services/audit.yaml new file mode 100644 index 000000000..51ac98369 --- /dev/null +++ b/src/Bundle/ChillMainBundle/config/services/audit.yaml @@ -0,0 +1,16 @@ +services: + _defaults: + autowire: true + autoconfigure: true + + Chill\MainBundle\Audit\: + resource: '../../Audit/*' + exclude: + - '../../Audit/Subject.php' + - '../../Audit/AuditEvent.php' + - '../../Audit/Exception/' + - '../../Audit/Exception/*' + + Chill\MainBundle\Audit\SubjectConverterManager: + arguments: + $converters: !tagged_iterator chill_main.audit_subject_converter