Skip to content

Commit

Permalink
get rid of false positives
Browse files Browse the repository at this point in the history
  • Loading branch information
ondrejmirtes committed Apr 28, 2022
1 parent 90f389b commit c0dcd57
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions src/Type/Php/StrContainingTypeSpecifyingExtension.php
Expand Up @@ -2,7 +2,12 @@

namespace PHPStan\Type\Php;

use PhpParser\Node\Arg;
use PhpParser\Node\Expr\BinaryOp\BooleanAnd;
use PhpParser\Node\Expr\BinaryOp\NotIdentical;
use PhpParser\Node\Expr\FuncCall;
use PhpParser\Node\Name;
use PhpParser\Node\Scalar\String_;
use PHPStan\Analyser\Scope;
use PHPStan\Analyser\SpecifiedTypes;
use PHPStan\Analyser\TypeSpecifier;
Expand Down Expand Up @@ -77,6 +82,15 @@ public function specifyTypes(FunctionReflection $functionReflection, FuncCall $n
$context,
false,
$scope,
new BooleanAnd(
new NotIdentical(
$args[$needleArg]->value,
new String_(''),
),
new FuncCall(new Name('FAUX_FUNCTION'), [
new Arg($args[$needleArg]->value),
]),
),
);
}
}
Expand Down

0 comments on commit c0dcd57

Please sign in to comment.