Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

[DependencyInjection][Xml] Fix the attribute 'tag' is not allowed in 'bind' tag #34732

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Nov 30, 2019
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
[DependencyInjection][Xml] Fix the attribute 'tag' is not allowed in …
…'bind' tag
  • Loading branch information
tienvx committed Nov 30, 2019
commit e38f7d41ef612cb29107dec80b1653cece4c9e45
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
Morty Proxy This is a proxified and sanitized view of the page, visit original site.