From 1244158ceb30af96f30f5fd09b0540f91df4fc55 Mon Sep 17 00:00:00 2001 From: Fabien Potencier Date: Mon, 7 May 2012 12:17:20 +0200 Subject: [PATCH] [DependencyInjection] made a small cleanup --- .../DependencyInjection/Loader/XmlFileLoader.php | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/src/Symfony/Component/DependencyInjection/Loader/XmlFileLoader.php b/src/Symfony/Component/DependencyInjection/Loader/XmlFileLoader.php index 98fb2dabf9..e4df83390b 100644 --- a/src/Symfony/Component/DependencyInjection/Loader/XmlFileLoader.php +++ b/src/Symfony/Component/DependencyInjection/Loader/XmlFileLoader.php @@ -44,7 +44,7 @@ class XmlFileLoader extends FileLoader $this->container->addResource(new FileResource($path)); // anonymous services - $xml = $this->processAnonymousServices($xml, $path); + $this->processAnonymousServices($xml, $path); // imports $this->parseImports($xml, $path); @@ -222,8 +222,6 @@ class XmlFileLoader extends FileLoader * * @param SimpleXMLElement $xml * @param string $file - * - * @return array An array of anonymous services */ private function processAnonymousServices(SimpleXMLElement $xml, $file) { @@ -232,7 +230,7 @@ class XmlFileLoader extends FileLoader // anonymous services as arguments if (false === $nodes = $xml->xpath('//container:argument[@type="service"][not(@id)]')) { - return $xml; + return; } foreach ($nodes as $node) { // give it a unique name @@ -244,7 +242,7 @@ class XmlFileLoader extends FileLoader // anonymous services "in the wild" if (false === $nodes = $xml->xpath('//container:services/container:service[not(@id)]')) { - return $xml; + return; } foreach ($nodes as $node) { // give it a unique name @@ -271,8 +269,6 @@ class XmlFileLoader extends FileLoader $oNode->parentNode->removeChild($oNode); } } - - return $xml; } /**