Skip to content

Commit 7d9573b

Browse files
authored
Simplify StrictFunctionCallsRule (#348)
1 parent fe4a0af commit 7d9573b

1 file changed

Lines changed: 1 addition & 3 deletions

File tree

‎src/Rules/StrictCalls/StrictFunctionCallsRule.php‎

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@
1111
use PHPStan\Reflection\ReflectionProvider;
1212
use PHPStan\Rules\Rule;
1313
use PHPStan\Rules\RuleErrorBuilder;
14-
use PHPStan\Type\Constant\ConstantBooleanType;
1514
use function array_key_exists;
1615
use function sprintf;
1716
use function strtolower;
@@ -79,8 +78,7 @@ public function processNode(Node $node, Scope $scope): array
7978
}
8079

8180
$argumentType = $scope->getType($node->getArgs()[$argumentPosition]->value);
82-
$trueType = new ConstantBooleanType(true);
83-
if (!$trueType->isSuperTypeOf($argumentType)->yes()) {
81+
if (!$argumentType->isTrue()->yes()) {
8482
return [
8583
RuleErrorBuilder::message(sprintf(
8684
'Call to function %s() requires parameter #%d to be true.',

0 commit comments

Comments
 (0)