Skip to content

Commit

Permalink
more substractable tests
Browse files Browse the repository at this point in the history
  • Loading branch information
staabm committed Aug 3, 2022
1 parent a2e719e commit 2134921
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
8 changes: 8 additions & 0 deletions tests/PHPStan/Analyser/LegacyNodeScopeResolverTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -2707,6 +2707,14 @@ public function dataBinaryOperations(): array
'array',
'$mixedNoFloat + []',
],
[
'(float|int)',
'$mixedNoFloat + 5',
],
[
'(float|int)',
'$mixedNoInt + 5',
],
[
'*ERROR*',
'$mixedNoArray + []',
Expand Down
3 changes: 3 additions & 0 deletions tests/PHPStan/Analyser/data/binary.php
Original file line number Diff line number Diff line change
Expand Up @@ -193,6 +193,9 @@ public function doFoo(array $generalArray)
if (!is_array($mixed)) {
$mixedNoArray = $mixed;
}
if (!is_int($mixed)) {
$mixedNoInt = $mixed;
}
if (!is_float($mixed)) {
$mixedNoFloat = $mixed;
}
Expand Down

0 comments on commit 2134921

Please sign in to comment.