has(SynchronizerLocator::class)) { return; } $locator = $container->findDefinition(SynchronizerLocator::class); // find all service IDs with the vario.synchronizer tag $taggedServices = $container->findTaggedServiceIds('money.synchronizer'); $locatableServices = []; $servicesByTypes = []; foreach ($taggedServices as $id => $tags) { /** @var SynchronizerInterface $class */ $class = $container->findDefinition($id)->getClass(); if (!$class::getType()) { continue; } $locatableServices[$id] = new Reference($id); $servicesByTypes[$class::getType()] = $id; } $locator->addArgument(ServiceLocatorTagPass::register($container, $locatableServices)); $locator->addArgument($servicesByTypes); } }