From 0fa19ea5a033cfe0040d8c4886d79241f47b35d4 Mon Sep 17 00:00:00 2001 From: Markus Staab Date: Tue, 3 Nov 2026 20:40:56 +0100 Subject: [PATCH] Simplify StrictFunctionCallsRule --- src/Rules/StrictCalls/StrictFunctionCallsRule.php | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/Rules/StrictCalls/StrictFunctionCallsRule.php b/src/Rules/StrictCalls/StrictFunctionCallsRule.php index f959fc9..9af4389 100644 --- a/src/Rules/StrictCalls/StrictFunctionCallsRule.php +++ b/src/Rules/StrictCalls/StrictFunctionCallsRule.php @@ -11,7 +11,6 @@ use PHPStan\Reflection\ReflectionProvider; use PHPStan\Rules\Rule; use PHPStan\Rules\RuleErrorBuilder; -use PHPStan\Type\Constant\ConstantBooleanType; use function array_key_exists; use function sprintf; use function strtolower; @@ -79,8 +78,7 @@ public function processNode(Node $node, Scope $scope): array } $argumentType = $scope->getType($node->getArgs()[$argumentPosition]->value); - $trueType = new ConstantBooleanType(true); - if (!$trueType->isSuperTypeOf($argumentType)->yes()) { + if (!$argumentType->isTrue()->yes()) { return [ RuleErrorBuilder::message(sprintf( 'Call to function %s() requires parameter #%d to be true.',