Browse Source

[DependencyInjection] made another speed optimization

Fabien Potencier 15 years ago
parent
commit
ce6f676eb2
1 changed files with 7 additions and 4 deletions
  1. 7 4
      src/Symfony/Components/DependencyInjection/Dumper/PhpDumper.php

+ 7 - 4
src/Symfony/Components/DependencyInjection/Dumper/PhpDumper.php

@@ -453,14 +453,17 @@ EOF;
     }
     else
     {
-      if ($this->container->hasDefinition($id) || $this->container->hasAlias($id))
+      if ($this->container->hasAlias($id))
       {
-        return sprintf('$this->get%sService()', Container::camelize($id));
+        $id = $this->container->getAlias($id);
       }
-      else
+
+      if ($this->container->hasDefinition($id))
       {
-        return sprintf('$this->getService(\'%s\')', $id);
+        return sprintf('$this->get%sService()', Container::camelize($id));
       }
+
+      return sprintf('$this->getService(\'%s\')', $id);
     }
   }
 }