We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 5e96f83 commit 70c71feCopy full SHA for 70c71fe
Compiler/AutowirePass.php
@@ -525,7 +525,16 @@ private static function getResourceMetadataForMethod(\ReflectionMethod $method)
525
$methodArgumentsMetadata = [];
526
foreach ($method->getParameters() as $parameter) {
527
try {
528
- $class = $parameter->getClass();
+ if (method_exists($parameter, 'getType')) {
529
+ $type = $parameter->getType();
530
+ if ($type && !$type->isBuiltin()) {
531
+ $class = new \ReflectionClass(method_exists($type, 'getName') ? $type->getName() : (string) $type);
532
+ } else {
533
+ $class = null;
534
+ }
535
536
+ $class = $parameter->getClass();
537
538
} catch (\ReflectionException $e) {
539
// type-hint is against a non-existent class
540
$class = false;
0 commit comments