Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 1 addition & 3 deletions src/Rules/StrictCalls/StrictFunctionCallsRule.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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.',
Expand Down
Loading