Skip to content

Commit

Permalink
ArrayFilterStrictRule - get rid of different behavour with `treatPhpD…
Browse files Browse the repository at this point in the history
…ocTypesAsCertain: false`
  • Loading branch information
ondrejmirtes committed Apr 19, 2024
1 parent 8afd4af commit 2e193a0
Showing 1 changed file with 1 addition and 6 deletions.
7 changes: 1 addition & 6 deletions src/Rules/Functions/ArrayFilterStrictRule.php
Expand Up @@ -83,12 +83,7 @@ public function processNode(Node $node, Scope $scope): array
}

if (count($args) === 1) {
if ($this->treatPhpDocTypesAsCertain) {
$arrayType = $scope->getType($args[0]->value);
} else {
$arrayType = $scope->getNativeType($args[0]->value);
}

$arrayType = $scope->getType($args[0]->value);
$itemType = $arrayType->getIterableValueType();
if ($itemType instanceof UnionType) {
$hasTruthy = false;
Expand Down

0 comments on commit 2e193a0

Please sign in to comment.