Pārlūkot izejas kodu

[DependencyInjection] removed the leading _ for anonymous service ids (the usage of strtr() in the conversion between ids and methods does not take leading _ into account like camelize() does)

Fabien Potencier 14 gadi atpakaļ
vecāks
revīzija
92f3d9e7ec

+ 2 - 2
src/Symfony/Component/DependencyInjection/Loader/XmlFileLoader.php

@@ -184,7 +184,7 @@ class XmlFileLoader extends FileLoader
         $nodes = $xml->xpath('//container:argument[@type="service"][not(@id)]');
         foreach ($nodes as $node) {
             // give it a unique name
-            $node['id'] = sprintf('_%s_%d', md5($file), ++$count);
+            $node['id'] = sprintf('%s_%d', md5($file), ++$count);
 
             $definitions[(string) $node['id']] = array($node->service, $file, false);
             $node->service['id'] = (string) $node['id'];
@@ -194,7 +194,7 @@ class XmlFileLoader extends FileLoader
         $nodes = $xml->xpath('//container:service[not(@id)]');
         foreach ($nodes as $node) {
             // give it a unique name
-            $node['id'] = sprintf('_%s_%d', md5($file), ++$count);
+            $node['id'] = sprintf('%s_%d', md5($file), ++$count);
 
             $definitions[(string) $node['id']] = array($node, $file, true);
             $node->service['id'] = (string) $node['id'];