diff --git a/src/Type/Php/DateIntervalDynamicReturnTypeExtension.php b/src/Type/Php/DateIntervalDynamicReturnTypeExtension.php index 1e5d4e7868a..9c2a1ab28f9 100644 --- a/src/Type/Php/DateIntervalDynamicReturnTypeExtension.php +++ b/src/Type/Php/DateIntervalDynamicReturnTypeExtension.php @@ -28,16 +28,10 @@ public function isStaticMethodSupported(MethodReflection $methodReflection): boo public function getTypeFromStaticMethodCall(MethodReflection $methodReflection, StaticCall $methodCall, Scope $scope): ?Type { - $defaultReturnType = ParametersAcceptorSelector::selectFromArgs( - $scope, - $methodCall->getArgs(), - $methodReflection->getVariants(), - )->getReturnType(); - $dateTimeString = $scope->getType($methodCall->getArgs()[0]->value); if (!($dateTimeString instanceof ConstantStringType)) { - return $defaultReturnType; + return null; } $isValid = DateInterval::createFromDateString($dateTimeString->getValue()) !== false;