Skip to content

Commit f32eec3

Browse files
committed
Update FinalPrivateMethodRuleTest.php
1 parent 17c3bed commit f32eec3

File tree

1 file changed

+10
-6
lines changed

1 file changed

+10
-6
lines changed

tests/PHPStan/Rules/Methods/FinalPrivateMethodRuleTest.php

+10-6
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44

55
use PHPStan\Rules\Rule;
66
use PHPStan\Testing\RuleTestCase;
7+
use function array_merge;
78
use 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
}

0 commit comments

Comments
 (0)