Skip to content

Commit ad4d41e

Browse files
committed
test
1 parent 294c130 commit ad4d41e

File tree

3 files changed

+49
-0
lines changed

3 files changed

+49
-0
lines changed
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
<?php declare(strict_types = 1);
2+
3+
namespace PHPStan\Rules\Methods;
4+
5+
use PHPStan\Rules\Rule;
6+
use PHPStan\Testing\RuleTestCase;
7+
8+
/** @extends RuleTestCase<FinalPrivateMethodRule> */
9+
class FinalPrivateMethodRuleConfigPhpTest extends RuleTestCase
10+
{
11+
12+
protected function getRule(): Rule
13+
{
14+
return new FinalPrivateMethodRule();
15+
}
16+
17+
public function testRulePhpVersions(): void
18+
{
19+
$this->analyse([__DIR__ . '/data/final-private-method-config-phpversion.php'], [
20+
[
21+
'Private method FinalPrivateMethodConfigPhpVersions\PhpVersionViaNEONConfg::foo() cannot be final as it is never overridden by other classes.',
22+
8,
23+
],
24+
]);
25+
}
26+
27+
public static function getAdditionalConfigFiles(): array
28+
{
29+
return [
30+
__DIR__ . '/data/final-private-php-version.neon',
31+
];
32+
}
33+
34+
}
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
<?php
2+
3+
namespace FinalPrivateMethodConfigPhpVersions;
4+
5+
class PhpVersionViaNEONConfg
6+
{
7+
8+
final private function foo(): void
9+
{
10+
}
11+
}
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
parameters:
2+
phpVersion:
3+
min: 80100
4+
max: 80499

0 commit comments

Comments
 (0)