Skip to content
Permalink
Browse files

Avoid false positive for param

  • Loading branch information...
muglug committed May 2, 2019
1 parent 4f26c8d commit 86bf159bd0eb20524dcd8af17f277d6e821ae1ff
@@ -28,8 +28,6 @@ public static function analyze(
PhpParser\Node\Expr\Ternary $stmt,
Context $context
) {
$context->referenced_var_ids = [];
$first_if_cond_expr = IfAnalyzer::getDefinitelyEvaluatedExpression($stmt->cond);
$context->inside_conditional = true;
@@ -908,8 +908,17 @@ function example2() : int {
* @psalm-suppress MissingParamType
*/
function foo($a) : void {
$b = "b";
$a->bar([$b]);
$b = "b";
$a->bar([$b]);
}',
],
'paramUsedInsideLoop' => [
'<?php
function foo(int $counter) : void {
foreach ([1, 2, 3] as $_) {
echo ($counter = $counter + 1);
echo rand(0, 1) ? 1 : 0;
}
}',
],
];

0 comments on commit 86bf159

Please sign in to comment.
You can’t perform that action at this time.