Skip to content

Commit

Permalink
One more test
Browse files Browse the repository at this point in the history
  • Loading branch information
ondrejmirtes committed May 6, 2020
1 parent 8cee183 commit b58d311
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions tests/PHPStan/Analyser/data/bug-2001.php
Original file line number Diff line number Diff line change
Expand Up @@ -34,4 +34,18 @@ public function parseUrl(string $url): string

return $redirectUrl;
}

public function doFoo(int $i)
{
$a = ['a' => $i];
if (rand(0, 1)) {
$a['b'] = $i;
}

if (rand(0,1)) {
$a = ['d' => $i];
}

assertType('array(\'a\' => int, ?\'b\' => int)|array(\'d\' => int)', $a);
}
}

0 comments on commit b58d311

Please sign in to comment.