From 45062c1e7144c632b2084835f0f4a33b2282fdb0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E0=B2=A0=5F=E0=B2=A0?= Date: Mon, 12 Dec 2022 18:04:58 +0100 Subject: [PATCH] just return null instead of the default type --- src/Type/Php/DateIntervalDynamicReturnTypeExtension.php | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) 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;