yield ['getMethodShouldBePublicInsteadProtected', 'foo',
sprintf('Either method "%s::getMethodShouldBePublicInsteadProtected()" should be public or tag "my_custom_tag" on service "service1" is missing attribute "foo".', FooTaggedForInvalidDefaultMethodClass::
class)];
yield ['getMethodShouldBePublicInsteadPrivate', null,
sprintf('Method "%s::getMethodShouldBePublicInsteadPrivate()" should be public.', FooTaggedForInvalidDefaultMethodClass::
class)];
yield ['getMethodShouldBePublicInsteadPrivate', 'foo',
sprintf('Either method "%s::getMethodShouldBePublicInsteadPrivate()" should be public or tag "my_custom_tag" on service "service1" is missing attribute "foo".', FooTaggedForInvalidDefaultMethodClass::
class)];
} public function testTaggedItemAttributes() { $container =
new ContainerBuilder();
$container->
register('service1', FooTagClass::
class)->
addTag('my_custom_tag'
);
$container->
register('service2', HelloNamedService::
class) ->
setAutoconfigured(true
) ->
setInstanceofConditionals([ HelloNamedService::
class => (new ChildDefinition(''
))->
addTag('my_custom_tag'
),
\stdClass::
class => (new ChildDefinition(''
))->
addTag('my_custom_tag2'
),
]);
$container->
register('service3', HelloNamedService2::
class) ->
setAutoconfigured(true
) ->
addTag('my_custom_tag'
);
$container->
register('service4', HelloNamedService2::
class) ->
setAutoconfigured(true
) ->
addTag('my_custom_tag'
);
$container->
register('service5', HelloNamedService2::
class) ->
setAutoconfigured(true
)