diff vendor/symfony/dependency-injection/Compiler/ResolveNamedArgumentsPass.php @ 17:129ea1e6d783

Update, including to Drupal core 8.6.10
author Chris Cannam
date Thu, 28 Feb 2019 13:21:36 +0000
parents 1fec387a4317
children af1871eacc83
line wrap: on
line diff
--- a/vendor/symfony/dependency-injection/Compiler/ResolveNamedArgumentsPass.php	Tue Jul 10 15:07:59 2018 +0100
+++ b/vendor/symfony/dependency-injection/Compiler/ResolveNamedArgumentsPass.php	Thu Feb 28 13:21:36 2019 +0000
@@ -33,15 +33,15 @@
         }
 
         $calls = $value->getMethodCalls();
-        $calls[] = array('__construct', $value->getArguments());
+        $calls[] = ['__construct', $value->getArguments()];
 
         foreach ($calls as $i => $call) {
             list($method, $arguments) = $call;
             $parameters = null;
-            $resolvedArguments = array();
+            $resolvedArguments = [];
 
             foreach ($arguments as $key => $argument) {
-                if (is_int($key)) {
+                if (\is_int($key)) {
                     $resolvedArguments[$key] = $argument;
                     continue;
                 }
@@ -49,6 +49,7 @@
                 if (null === $parameters) {
                     $r = $this->getReflectionMethod($value, $method);
                     $class = $r instanceof \ReflectionMethod ? $r->class : $this->currentId;
+                    $method = $r->getName();
                     $parameters = $r->getParameters();
                 }
 
@@ -65,7 +66,7 @@
                 }
 
                 if (null !== $argument && !$argument instanceof Reference && !$argument instanceof Definition) {
-                    throw new InvalidArgumentException(sprintf('Invalid service "%s": the value of argument "%s" of method "%s()" must be null, an instance of %s or an instance of %s, %s given.', $this->currentId, $key, $class !== $this->currentId ? $class.'::'.$method : $method, Reference::class, Definition::class, gettype($argument)));
+                    throw new InvalidArgumentException(sprintf('Invalid service "%s": the value of argument "%s" of method "%s()" must be null, an instance of %s or an instance of %s, %s given.', $this->currentId, $key, $class !== $this->currentId ? $class.'::'.$method : $method, Reference::class, Definition::class, \gettype($argument)));
                 }
 
                 $typeFound = false;