Mercurial > hg > cmmr2012-drupal-site
comparison 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 |
comparison
equal
deleted
inserted
replaced
4:a9cd425dd02b | 5:12f9dff5fda9 |
---|---|
179 list($method, $arguments) = $call; | 179 list($method, $arguments) = $call; |
180 | 180 |
181 if ($method instanceof \ReflectionFunctionAbstract) { | 181 if ($method instanceof \ReflectionFunctionAbstract) { |
182 $reflectionMethod = $method; | 182 $reflectionMethod = $method; |
183 } else { | 183 } else { |
184 $reflectionMethod = $this->getReflectionMethod(new Definition($reflectionClass->name), $method); | 184 $definition = new Definition($reflectionClass->name); |
185 try { | |
186 $reflectionMethod = $this->getReflectionMethod($definition, $method); | |
187 } catch (RuntimeException $e) { | |
188 if ($definition->getFactory()) { | |
189 continue; | |
190 } | |
191 throw $e; | |
192 } | |
185 } | 193 } |
186 | 194 |
187 $arguments = $this->autowireMethod($reflectionMethod, $arguments); | 195 $arguments = $this->autowireMethod($reflectionMethod, $arguments); |
188 | 196 |
189 if ($arguments !== $call[1]) { | 197 if ($arguments !== $call[1]) { |
212 if (method_exists('ReflectionMethod', 'isVariadic') && $reflectionMethod->isVariadic()) { | 220 if (method_exists('ReflectionMethod', 'isVariadic') && $reflectionMethod->isVariadic()) { |
213 array_pop($parameters); | 221 array_pop($parameters); |
214 } | 222 } |
215 | 223 |
216 foreach ($parameters as $index => $parameter) { | 224 foreach ($parameters as $index => $parameter) { |
217 if (array_key_exists($index, $arguments) && '' !== $arguments[$index]) { | 225 if (\array_key_exists($index, $arguments) && '' !== $arguments[$index]) { |
218 continue; | 226 continue; |
219 } | 227 } |
220 | 228 |
221 $type = ProxyHelper::getTypeHint($reflectionMethod, $parameter, true); | 229 $type = ProxyHelper::getTypeHint($reflectionMethod, $parameter, true); |
222 | 230 |