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

Commit caca373

Browse filesBrowse files
committed
the string "0" is a valid service identifier
1 parent 7789a99 commit caca373
Copy full SHA for caca373

File tree

Expand file treeCollapse file tree

2 files changed

+6
-2
lines changed
Filter options
Expand file treeCollapse file tree

2 files changed

+6
-2
lines changed

‎src/Symfony/Component/DependencyInjection/Loader/XmlFileLoader.php

Copy file name to clipboardExpand all lines: src/Symfony/Component/DependencyInjection/Loader/XmlFileLoader.php
+2-2Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -496,7 +496,7 @@ private function getArgumentsAsPhp(\DOMElement $node, $name, $file, $lowercase =
496496

497497
switch ($arg->getAttribute('type')) {
498498
case 'service':
499-
if (!$arg->getAttribute('id')) {
499+
if ('' === $arg->getAttribute('id')) {
500500
throw new InvalidArgumentException(sprintf('Tag "<%s>" with type="service" has no or empty "id" attribute in "%s".', $name, $file));
501501
}
502502
if ($arg->hasAttribute('strict')) {
@@ -549,7 +549,7 @@ private function getArgumentsAsPhp(\DOMElement $node, $name, $file, $lowercase =
549549
* @param \DOMNode $node
550550
* @param mixed $name
551551
*
552-
* @return array
552+
* @return \DOMElement[]
553553
*/
554554
private function getChildren(\DOMNode $node, $name)
555555
{

‎src/Symfony/Component/DependencyInjection/Tests/Fixtures/xml/services6.xml

Copy file name to clipboardExpand all lines: src/Symfony/Component/DependencyInjection/Tests/Fixtures/xml/services6.xml
+4Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,5 +61,9 @@
6161
</service>
6262
<service id="alias_for_foo" alias="foo" />
6363
<service id="another_alias_for_foo" alias="foo" public="false" />
64+
<service id="0" class="FooClass" />
65+
<service id="1" class="FooClass">
66+
<argument type="service" id="0" />
67+
</service>
6468
</services>
6569
</container>

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.