Skip to content

Commit 1b56b0c

Browse files
committed
RuleTestCase - set shouldPolluteScopeWithLoopInitialAssignments to true which is PHPStan's default behaviour
1 parent c8833df commit 1b56b0c

File tree

3 files changed

+8
-8
lines changed

3 files changed

+8
-8
lines changed

src/Testing/RuleTestCase.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -206,7 +206,7 @@ public function gatherAnalyserErrors(array $files): array
206206

207207
protected function shouldPolluteScopeWithLoopInitialAssignments(): bool
208208
{
209-
return false;
209+
return true;
210210
}
211211

212212
protected function shouldPolluteScopeWithAlwaysIterableForeach(): bool

tests/PHPStan/Rules/Comparison/StrictComparisonOfDifferentTypesRuleTest.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -151,7 +151,7 @@ public function testStrictComparison(): void
151151
335,
152152
],
153153
[
154-
'Strict comparison using === between int<0, max> and \'string\' will always evaluate to false.',
154+
'Strict comparison using === between int<1, max> and \'string\' will always evaluate to false.',
155155
343,
156156
],
157157
[

tests/PHPStan/Rules/Properties/data/access-properties-after-isnull.php

+6-6
Original file line numberDiff line numberDiff line change
@@ -33,22 +33,22 @@ public function doFoo($foo)
3333
}
3434

3535
while (is_null($foo) && $foo->fooProperty) {
36-
36+
break;
3737
}
3838
while (is_null($foo) || $foo->fooProperty) {
39-
39+
break;
4040
}
4141
while (!is_null($foo) && $foo->fooProperty) {
42-
42+
break;
4343
}
4444
while (!is_null($foo) || $foo->fooProperty) {
45-
45+
break;
4646
}
4747
while (is_null($foo) || $foo->barProperty) {
48-
48+
break;
4949
}
5050
while (!is_null($foo) && $foo->barProperty) {
51-
51+
break;
5252
}
5353
}
5454

0 commit comments

Comments
 (0)