File tree 1 file changed +10
-6
lines changed
tests/PHPStan/Rules/Methods
1 file changed +10
-6
lines changed Original file line number Diff line number Diff line change 4
4
5
5
use PHPStan \Rules \Rule ;
6
6
use PHPStan \Testing \RuleTestCase ;
7
+ use function array_merge ;
7
8
use const PHP_VERSION_ID ;
8
9
9
10
/** @extends RuleTestCase<FinalPrivateMethodRule> */
@@ -17,16 +18,17 @@ protected function getRule(): Rule
17
18
18
19
public function testRule (): void
19
20
{
20
- $ error = [];
21
+ $ errors = [];
21
22
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
+ ],
25
28
];
26
29
}
27
30
28
- $ this ->analyse ([__DIR__ . '/data/final-private-method.php ' ], [
29
- $ error ,
31
+ $ errors = array_merge ($ errors , [
30
32
[
31
33
'Private method FinalPrivateMethod\FooBarPhp8orHigher::foo() cannot be final as it is never overridden by other classes. ' ,
32
34
39 ,
@@ -40,6 +42,8 @@ public function testRule(): void
40
42
69 ,
41
43
],
42
44
]);
45
+
46
+ $ this ->analyse ([__DIR__ . '/data/final-private-method.php ' ], $ errors );
43
47
}
44
48
45
49
}
You can’t perform that action at this time.
0 commit comments