Explorar o código

[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 %!s(int64=14) %!d(string=hai) anos
pai
achega
fc96702483
Modificáronse 1 ficheiros con 1 adicións e 5 borrados
  1. 1 5
      src/Symfony/Component/DependencyInjection/Definition.php

+ 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();
     }
 
     /**