Skip to content
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

[DependencyInjection] the string "0" is a valid service identifier #29894

Merged
merged 1 commit into from Jan 15, 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.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Expand Up @@ -496,7 +496,7 @@ private function getArgumentsAsPhp(\DOMElement $node, $name, $file, $lowercase =

switch ($arg->getAttribute('type')) {
case 'service':
if (!$arg->getAttribute('id')) {
if ('' === $arg->getAttribute('id')) {
throw new InvalidArgumentException(sprintf('Tag "<%s>" with type="service" has no or empty "id" attribute in "%s".', $name, $file));
}
if ($arg->hasAttribute('strict')) {
Expand Down Expand Up @@ -549,7 +549,7 @@ private function getArgumentsAsPhp(\DOMElement $node, $name, $file, $lowercase =
* @param \DOMNode $node
* @param mixed $name
*
* @return array
* @return \DOMElement[]
*/
private function getChildren(\DOMNode $node, $name)
{
Expand Down
Expand Up @@ -61,5 +61,9 @@
</service>
<service id="alias_for_foo" alias="foo" />
<service id="another_alias_for_foo" alias="foo" public="false" />
<service id="0" class="FooClass" />
<service id="1" class="FooClass">
<argument type="service" id="0" />
</service>
</services>
</container>