Skip to content

Commit 2068060

Browse files
committed
Merge branch '3.4' into 4.1
* 3.4: the string "0" is a valid service identifier remove unreachable code updated MimeType extensions
2 parents 9629e8d + 9150ac7 commit 2068060

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

Loader/XmlFileLoader.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -482,7 +482,7 @@ private function getArgumentsAsPhp(\DOMElement $node, $name, $file, $lowercase =
482482

483483
switch ($arg->getAttribute('type')) {
484484
case 'service':
485-
if (!$arg->getAttribute('id')) {
485+
if ('' === $arg->getAttribute('id')) {
486486
throw new InvalidArgumentException(sprintf('Tag "<%s>" with type="service" has no or empty "id" attribute in "%s".', $name, $file));
487487
}
488488

@@ -538,7 +538,7 @@ private function getArgumentsAsPhp(\DOMElement $node, $name, $file, $lowercase =
538538
* @param \DOMNode $node
539539
* @param mixed $name
540540
*
541-
* @return array
541+
* @return \DOMElement[]
542542
*/
543543
private function getChildren(\DOMNode $node, $name)
544544
{

Tests/Fixtures/xml/services6.xml

Lines 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)