Updated Drupal to 8.6. This goes with the following updates because it's possible...
[yaffs-website] / vendor / symfony / dependency-injection / Compiler / ResolveInstanceofConditionalsPass.php
index 15110261a225273f54fb17c25ffc7629c09fe9db..20507cfb56980a510ba8e1819f0ed8dcde86bab0 100644 (file)
@@ -14,8 +14,8 @@ namespace Symfony\Component\DependencyInjection\Compiler;
 use Symfony\Component\DependencyInjection\ChildDefinition;
 use Symfony\Component\DependencyInjection\ContainerBuilder;
 use Symfony\Component\DependencyInjection\Definition;
-use Symfony\Component\DependencyInjection\Exception\RuntimeException;
 use Symfony\Component\DependencyInjection\Exception\InvalidArgumentException;
+use Symfony\Component\DependencyInjection\Exception\RuntimeException;
 
 /**
  * Applies instanceof conditionals to definitions.
@@ -105,11 +105,11 @@ class ResolveInstanceofConditionalsPass implements CompilerPassInterface
                 $definition->setShared($shared);
             }
 
-            $i = count($instanceofTags);
+            $i = \count($instanceofTags);
             while (0 <= --$i) {
                 foreach ($instanceofTags[$i] as $k => $v) {
                     foreach ($v as $v) {
-                        if ($definition->hasTag($k) && in_array($v, $definition->getTag($k))) {
+                        if ($definition->hasTag($k) && \in_array($v, $definition->getTag($k))) {
                             continue;
                         }
                         $definition->addTag($k, $v);
@@ -117,9 +117,11 @@ class ResolveInstanceofConditionalsPass implements CompilerPassInterface
                 }
             }
 
+            $definition->setBindings($bindings);
+
             // reset fields with "merge" behavior
             $abstract
-                ->setBindings($bindings)
+                ->setBindings(array())
                 ->setArguments(array())
                 ->setMethodCalls(array())
                 ->setDecoratedService(null)