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.
This commit is contained in:
2026-01-28 16:19:54 +01:00
parent 1de7da709c
commit 59b322ee8e
3 changed files with 20 additions and 0 deletions

View File

@@ -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);

View File

@@ -3,6 +3,7 @@ parameters:
imports:
- ./services/clock.yaml
- ./services/audit.yaml
services:
_defaults:

View File

@@ -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