diff vendor/symfony/dependency-injection/Compiler/AutowirePass.php @ 5:12f9dff5fda9 tip

Update to Drupal core 8.7.1
author Chris Cannam
date Thu, 09 May 2019 15:34:47 +0100
parents a9cd425dd02b
children
line wrap: on
line diff
--- a/vendor/symfony/dependency-injection/Compiler/AutowirePass.php	Thu Feb 28 13:11:55 2019 +0000
+++ b/vendor/symfony/dependency-injection/Compiler/AutowirePass.php	Thu May 09 15:34:47 2019 +0100
@@ -181,7 +181,15 @@
             if ($method instanceof \ReflectionFunctionAbstract) {
                 $reflectionMethod = $method;
             } else {
-                $reflectionMethod = $this->getReflectionMethod(new Definition($reflectionClass->name), $method);
+                $definition = new Definition($reflectionClass->name);
+                try {
+                    $reflectionMethod = $this->getReflectionMethod($definition, $method);
+                } catch (RuntimeException $e) {
+                    if ($definition->getFactory()) {
+                        continue;
+                    }
+                    throw $e;
+                }
             }
 
             $arguments = $this->autowireMethod($reflectionMethod, $arguments);
@@ -214,7 +222,7 @@
         }
 
         foreach ($parameters as $index => $parameter) {
-            if (array_key_exists($index, $arguments) && '' !== $arguments[$index]) {
+            if (\array_key_exists($index, $arguments) && '' !== $arguments[$index]) {
                 continue;
             }