2022-11-23 10:59:55 +01:00
|
|
|
<?php
|
|
|
|
|
|
|
|
declare(strict_types=1);
|
|
|
|
|
2023-11-09 10:27:43 +01:00
|
|
|
namespace WerkraumMedia\Events;
|
2022-11-23 10:59:55 +01:00
|
|
|
|
|
|
|
use Symfony\Component\DependencyInjection\Compiler\CompilerPassInterface;
|
|
|
|
use Symfony\Component\DependencyInjection\ContainerBuilder;
|
|
|
|
use Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigurator;
|
2023-11-09 10:27:43 +01:00
|
|
|
use WerkraumMedia\Events\Service\DestinationDataImportService\Slugger\Registry;
|
|
|
|
use WerkraumMedia\Events\Service\DestinationDataImportService\Slugger\SluggerType;
|
2022-11-23 10:59:55 +01:00
|
|
|
|
|
|
|
return static function (ContainerConfigurator $container, ContainerBuilder $containerBuilder) {
|
|
|
|
$containerBuilder->registerForAutoconfiguration(SluggerType::class)->addTag('tx_events.slugger_type');
|
|
|
|
$containerBuilder->addCompilerPass(new class() implements CompilerPassInterface {
|
|
|
|
public function process(ContainerBuilder $container): void
|
|
|
|
{
|
|
|
|
$registry = $container->getDefinition(Registry::class);
|
|
|
|
foreach (array_keys($container->findTaggedServiceIds('tx_events.slugger_type')) as $serviceId) {
|
|
|
|
$registry->addMethodCall('add', [$container->getDefinition($serviceId)]);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
});
|
|
|
|
};
|