Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -222,6 +222,7 @@
<xsd:attribute name="key" type="xsd:string" use="required" />
<xsd:attribute name="on-invalid" type="invalid_sequence" />
<xsd:attribute name="method" type="xsd:string" />
<xsd:attribute name="tag" type="xsd:string" />
</xsd:complexType>

<xsd:complexType name="argument" mixed="true">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ class Bar implements BarInterface
{
public $quz;

public function __construct($quz = null, \NonExistent $nonExistent = null, BarInterface $decorated = null, array $foo = [])
public function __construct($quz = null, \NonExistent $nonExistent = null, BarInterface $decorated = null, array $foo = [], iterable $baz = [])
{
$this->quz = $quz;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
<bind key="$foo" type="collection">
<bind>null</bind>
</bind>
<bind key="iterable $baz" type="tagged_iterator" tag="bar"/>
</service>

<service id="Symfony\Component\DependencyInjection\Tests\Fixtures\Bar">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ services:
bind:
Symfony\Component\DependencyInjection\Tests\Fixtures\BarInterface: '@Symfony\Component\DependencyInjection\Tests\Fixtures\Bar'
$foo: [ ~ ]
iterable $baz: !tagged_iterator bar

Symfony\Component\DependencyInjection\Tests\Fixtures\Bar:
factory: [ ~, 'create' ]
Original file line number Diff line number Diff line change
Expand Up @@ -879,12 +879,14 @@ public function testBindings()
'$foo' => [null],
'$quz' => 'quz',
'$factory' => 'factory',
'iterable $baz' => new TaggedIteratorArgument('bar'),
], array_map(function (BoundArgument $v) { return $v->getValues()[0]; }, $definition->getBindings()));
$this->assertEquals([
'quz',
null,
new Reference(Bar::class),
[null],
new TaggedIteratorArgument('bar'),
], $definition->getArguments());

$definition = $container->getDefinition(Bar::class);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -801,12 +801,14 @@ public function testBindings()
'$foo' => [null],
'$quz' => 'quz',
'$factory' => 'factory',
'iterable $baz' => new TaggedIteratorArgument('bar'),
], array_map(function (BoundArgument $v) { return $v->getValues()[0]; }, $definition->getBindings()));
$this->assertEquals([
'quz',
null,
new Reference(Bar::class),
[null],
new TaggedIteratorArgument('bar'),
], $definition->getArguments());

$definition = $container->getDefinition(Bar::class);
Expand Down