hasDefinition('chill.main.role_provider')) { throw new LogicException('service chill.main.role_provider ' . 'is not defined. It is required by RoleProviderCompilerPass'); } $definition = $container->getDefinition( 'chill.main.role_provider' ); $taggedServices = $container->findTaggedServiceIds( 'chill.role' ); foreach ($taggedServices as $id => $tagAttributes) { $definition->addMethodCall( 'addProvider', [new Reference($id)] ); } } }