Skip to content

Commit 870927a

Browse files
committed
Adjust other tests with more precise analysis results
1 parent 080658c commit 870927a

File tree

3 files changed

+3
-8
lines changed

3 files changed

+3
-8
lines changed

tests/PHPStan/Analyser/nsrt/in-array-enum.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,11 +54,11 @@ public function looseCheckEnumSpecifyHaystack(array $haystack): void
5454
}
5555

5656
if (! in_array(rand() ? FooUnitEnum::A : FooUnitEnum::B, $haystack, true)) {
57-
assertType('array<InArrayEnum\FooUnitEnum|int>', $haystack);
57+
assertType('array<int>', $haystack);
5858
}
5959

6060
if (! in_array(rand() ? 5 : 6, $haystack, true)) {
61-
assertType('array<InArrayEnum\FooUnitEnum|int>', $haystack);
61+
assertType('array<InArrayEnum\FooUnitEnum|int<min, 4>|int<7, max>>', $haystack);
6262
}
6363

6464
if (! in_array(rand() ? 5 : rand(), $haystack, true)) {

tests/PHPStan/Analyser/nsrt/in-array-haystack-subtract.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ class Foo
1111
public function specifyHaystack(array $haystack): void
1212
{
1313
if (! in_array(rand() ? 5 : 6, $haystack, true)) {
14-
assertType('array<int>', $haystack);
14+
assertType('array<int<min, 4>|int<7, max>>', $haystack);
1515
}
1616
}
1717

tests/PHPStan/Rules/Comparison/ImpossibleCheckTypeFunctionCallRuleTest.php

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -803,27 +803,22 @@ private static function getLooseComparisonAgainsEnumsIssues(): array
803803
[
804804
'Call to function in_array() with arguments LooseComparisonAgainstEnums\FooUnitEnum, array<string> and false will always evaluate to false.',
805805
128,
806-
$tipText,
807806
],
808807
[
809808
'Call to function in_array() with arguments LooseComparisonAgainstEnums\FooUnitEnum, array<string> and true will always evaluate to false.',
810809
131,
811-
$tipText,
812810
],
813811
[
814812
'Call to function in_array() with string and array<LooseComparisonAgainstEnums\FooUnitEnum> will always evaluate to false.',
815813
143,
816-
$tipText,
817814
],
818815
[
819816
'Call to function in_array() with arguments string, array<LooseComparisonAgainstEnums\FooUnitEnum> and false will always evaluate to false.',
820817
146,
821-
$tipText,
822818
],
823819
[
824820
'Call to function in_array() with arguments string, array<LooseComparisonAgainstEnums\FooUnitEnum> and true will always evaluate to false.',
825821
149,
826-
$tipText,
827822
],
828823
[
829824
'Call to function in_array() with LooseComparisonAgainstEnums\FooUnitEnum::B and non-empty-array<LooseComparisonAgainstEnums\FooUnitEnum::A> will always evaluate to false.',

0 commit comments

Comments
 (0)