hasDefinition('chill.custom_field.provider')) { throw new LogicException('service chill.custom_field.provider ' . 'is not defined.'); } $definition = $container->getDefinition( 'chill.custom_field.provider' ); $taggedServices = $container->findTaggedServiceIds( 'chill.custom_field' ); foreach ($taggedServices as $id => $tagAttributes) { foreach ($tagAttributes as $attributes) { $definition->addMethodCall( 'addCustomField', [new Reference($id), $attributes['type']] ); } } } }