'autowired' =>
new ServiceClosureArgument(new TypedReference('stdClass', 'stdClass', ContainerInterface::EXCEPTION_ON_INVALID_REFERENCE, 'autowired',
[new Autowire(service: 'service.id'
)])),
'autowired.nullable' =>
new ServiceClosureArgument(new TypedReference('stdClass', 'stdClass', ContainerInterface::IGNORE_ON_INVALID_REFERENCE, 'autowired.nullable',
[new Autowire(service: 'service.id'
)])),
'autowired.parameter' =>
new ServiceClosureArgument(new TypedReference('string', 'string', ContainerInterface::EXCEPTION_ON_INVALID_REFERENCE, 'autowired.parameter',
[new Autowire(service: '%parameter.1%'
)])),
'autowire.decorated' =>
new ServiceClosureArgument(new TypedReference('stdClass', 'stdClass', ContainerInterface::EXCEPTION_ON_INVALID_REFERENCE, 'autowire.decorated',
[new AutowireDecorated()])),
'target' =>
new ServiceClosureArgument(new TypedReference('stdClass', 'stdClass', ContainerInterface::EXCEPTION_ON_INVALID_REFERENCE, 'target',
[new Target('someTarget'
)])),
];
$this->
assertEquals($expected,
$container->
getDefinition((string) $locator->
getFactory()[0
])->
getArgument(0
));
(new AutowirePass())->
process($container);
$expected =
[ 'tagged.iterator' =>
new ServiceClosureArgument(new TaggedIteratorArgument('tag'
)),
'tagged.locator' =>
new ServiceClosureArgument(new ServiceLocatorArgument(new TaggedIteratorArgument('tag', 'tag', needsIndexes: true
))),
'autowired' =>
new ServiceClosureArgument(new TypedReference('service.id', 'stdClass', ContainerInterface::EXCEPTION_ON_INVALID_REFERENCE, 'autowired',
[new Autowire(service: 'service.id'
)])),
'autowired.nullable' =>
new ServiceClosureArgument(new TypedReference('service.id', 'stdClass', ContainerInterface::IGNORE_ON_INVALID_REFERENCE, 'autowired.nullable',
[new Autowire(service: 'service.id'
)])),
'autowired.parameter' =>
new ServiceClosureArgument('foobar'
),
'autowire.decorated' =>
new ServiceClosureArgument(new Reference('.service_locator.0tSxobl.inner', ContainerInterface::NULL_ON_INVALID_REFERENCE
)),
'target' =>
new ServiceClosureArgument(new TypedReference('stdClass', 'stdClass', ContainerInterface::EXCEPTION_ON_INVALID_REFERENCE, 'target',
[new Target('someTarget'
)])),
];
$this->
assertEquals($expected,
$container->
getDefinition((string) $locator->
getFactory()[0
])->
getArgument(0
));
} public function testBinding() {