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

[TwigBundle] addExtension calls must be first

partugal преди 14 години
родител
ревизия
5ac67a23e7
променени са 1 файла, в които са добавени 4 реда и са изтрити 0 реда
  1. 4 0
      src/Symfony/Bundle/TwigBundle/DependencyInjection/Compiler/TwigEnvironmentPass.php

+ 4 - 0
src/Symfony/Bundle/TwigBundle/DependencyInjection/Compiler/TwigEnvironmentPass.php

@@ -30,8 +30,12 @@ class TwigEnvironmentPass implements CompilerPassInterface
 
         $definition = $container->getDefinition('twig');
 
+        // addExtension must be first
+        $calls = $definition->getMethodCalls();
+        $definition->setMethodCalls(array());
         foreach ($container->findTaggedServiceIds('twig.extension') as $id => $attributes) {
             $definition->addMethodCall('addExtension', array(new Reference($id)));
         }
+        $definition->setMethodCalls(array_merge($definition->getMethodCalls(), $calls));
     }
 }