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 edf0856 commit 7ffd96dCopy full SHA for 7ffd96d
src/ReturnTypeExtension/NodeGetAttributeTypeExtension.php
@@ -51,18 +51,16 @@ public function getTypeFromMethodCall(
51
MethodReflection $methodReflection,
52
MethodCall $methodCall,
53
Scope $scope
54
- ): Type {
55
- $returnType = ParametersAcceptorSelector::selectSingle($methodReflection->getVariants())->getReturnType();
56
-
+ ): ?Type {
57
$firstArg = $methodCall->getArgs()[0];
58
59
$argumentValue = $this->resolveArgumentValue($firstArg->value);
60
if ($argumentValue === null) {
61
- return $returnType;
+ return null;
62
}
63
64
if (! isset(self::ARGUMENT_KEY_TO_RETURN_TYPE[$argumentValue])) {
65
66
67
68
$knownReturnType = self::ARGUMENT_KEY_TO_RETURN_TYPE[$argumentValue];
0 commit comments