Преглед на файлове

Merge remote branch 'lsmith77/prevent_redundant_DI_method_calls'

* lsmith77/prevent_redundant_DI_method_calls:
  do not add method calls from interface injection if a method call has already been set manually
Fabien Potencier преди 14 години
родител
ревизия
0d61ae06b4
променени са 1 файла, в които са добавени 3 реда и са изтрити 1 реда
  1. 3 1
      src/Symfony/Component/DependencyInjection/InterfaceInjector.php

+ 3 - 1
src/Symfony/Component/DependencyInjection/InterfaceInjector.php

@@ -76,7 +76,9 @@ class InterfaceInjector
 
         foreach ($this->calls as $callback) {
             list($method, $arguments) = $callback;
-            $definition->addMethodCall($method, $arguments);
+            if (!$definition->hasMethodCall($method)) {
+                $definition->addMethodCall($method, $arguments);
+            }
         }
 
         $this->processedDefinitions[] = $definition;