getDefinition(PermissionsGroupType::class); foreach ($container->findTaggedServiceIds('chill_main.flags') as $id => $tags) { $reference = new Reference($id); foreach ($tags as $tag) { switch ($tag['scope']) { case PermissionsGroupType::FLAG_SCOPE: $permissionGroupType->addMethodCall('addFlagProvider', [$reference]); break; default: throw new LogicException( sprintf( "This tag 'scope' is not implemented: %s, on service with id %s", $tag['scope'], $id ) ); } } } } }