File tree Expand file tree Collapse file tree 1 file changed +10
-6
lines changed
tests/PHPStan/Rules/Methods Expand file tree Collapse file tree 1 file changed +10
-6
lines changed Original file line number Diff line number Diff line change 44
55use PHPStan \Rules \Rule ;
66use PHPStan \Testing \RuleTestCase ;
7+ use function array_merge ;
78use const PHP_VERSION_ID ;
89
910/** @extends RuleTestCase<FinalPrivateMethodRule> */
@@ -17,16 +18,17 @@ protected function getRule(): Rule
1718
1819 public function testRule (): void
1920 {
20- $ error = [];
21+ $ errors = [];
2122 if (PHP_VERSION_ID >= 80000 ) {
22- $ error = [
23- 'Private method FinalPrivateMethod\Foo::foo() cannot be final as it is never overridden by other classes. ' ,
24- 8 ,
23+ $ errors = [
24+ [
25+ 'Private method FinalPrivateMethod\Foo::foo() cannot be final as it is never overridden by other classes. ' ,
26+ 8 ,
27+ ],
2528 ];
2629 }
2730
28- $ this ->analyse ([__DIR__ . '/data/final-private-method.php ' ], [
29- $ error ,
31+ $ errors = array_merge ($ errors , [
3032 [
3133 'Private method FinalPrivateMethod\FooBarPhp8orHigher::foo() cannot be final as it is never overridden by other classes. ' ,
3234 39 ,
@@ -40,6 +42,8 @@ public function testRule(): void
4042 69 ,
4143 ],
4244 ]);
45+
46+ $ this ->analyse ([__DIR__ . '/data/final-private-method.php ' ], $ errors );
4347 }
4448
4549}
You can’t perform that action at this time.
0 commit comments