Skip to content

Commit 5d6f582

Browse files
Fix
1 parent 0608ee0 commit 5d6f582

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

src/Type/Php/FilterVarThrowTypeExtension.php

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,9 +30,7 @@ public function isFunctionSupported(
3030
FunctionReflection $functionReflection,
3131
): bool
3232
{
33-
return $functionReflection->getName() === 'filter_var'
34-
&& $this->phpVersion->hasFilterThrowOnFailureConstant()
35-
&& $this->reflectionProvider->hasConstant(new Name\FullyQualified('FILTER_THROW_ON_FAILURE'), null);
33+
return $functionReflection->getName() === 'filter_var';
3634
}
3735

3836
public function getThrowTypeFromFunctionCall(
@@ -45,6 +43,13 @@ public function getThrowTypeFromFunctionCall(
4543
return null;
4644
}
4745

46+
if (
47+
!$this->phpVersion->hasFilterThrowOnFailureConstant()
48+
|| !$this->reflectionProvider->hasConstant(new Name\FullyQualified('FILTER_THROW_ON_FAILURE'), null)
49+
) {
50+
return null;
51+
}
52+
4853
$flagsExpr = $funcCall->getArgs()[3]->value;
4954
$flagsType = $scope->getType($flagsExpr);
5055

0 commit comments

Comments
 (0)