Skip to content

Commit 8c8f788

Browse files
committed
fix
1 parent fcb8fe5 commit 8c8f788

2 files changed

Lines changed: 11 additions & 5 deletions

File tree

src/Rules/Comparison/ImpossibleCheckTypeHelper.php

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -268,6 +268,17 @@ public function findSpecifiedType(
268268
return null;
269269
}
270270

271+
if ($node instanceof Expr\CallLike) {
272+
foreach ($node->getArgs() as $arg) {
273+
if (
274+
$arg->value === $rootExpr
275+
&& $scope->getType($arg->value)->isConstantScalarValue()->yes()
276+
) {
277+
return null;
278+
}
279+
}
280+
}
281+
271282
$rootExprType = ($this->treatPhpDocTypesAsCertain ? $scope->getType($rootExpr) : $scope->getNativeType($rootExpr));
272283
if ($rootExprType instanceof ConstantBooleanType) {
273284
return $rootExprType->getValue();

src/Rules/Comparison/ImpossibleCheckTypeStaticMethodCallRule.php

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -49,11 +49,6 @@ public function processNode(Node $node, Scope $scope): array
4949
return [];
5050
}
5151

52-
$returnType = $scope->getKeepVoidType($node);
53-
if ($returnType->isVoid()->yes()) {
54-
return [];
55-
}
56-
5752
$addTip = function (RuleErrorBuilder $ruleErrorBuilder) use ($scope, $node): RuleErrorBuilder {
5853
if (!$this->treatPhpDocTypesAsCertain) {
5954
return $ruleErrorBuilder;

0 commit comments

Comments
 (0)