Ver código fonte

[DependencyInjection] fixed generation of empty tags when getting a tag from a definition

This change removes a lot of noise in the dumped container.
Fabien Potencier 14 anos atrás
pai
commit
fc96702483

+ 1 - 5
src/Symfony/Component/DependencyInjection/Definition.php

@@ -253,11 +253,7 @@ class Definition
      */
     public function getTag($name)
     {
-        if (!isset($this->tags[$name])) {
-            $this->tags[$name] = array();
-        }
-
-        return $this->tags[$name];
+        return isset($this->tags[$name]) ? $this->tags[$name] : array();
     }
 
     /**