Skip to content

Commit

Permalink
Fix: Add test case
Browse files Browse the repository at this point in the history
Related to #893.
  • Loading branch information
localheinz committed Jan 6, 2025
1 parent 8f69c05 commit 2193f14
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
<?php

declare(strict_types=1);

namespace Ergebnis\PHPStan\Rules\Test\Fixture\Methods\PrivateInFinalClassRule;

final class FinalClassOverridingProtectedMethodFromTrait
{
use TraitWithProtectedMethod;

protected function method(): void
{
}
}
7 changes: 7 additions & 0 deletions test/Integration/Methods/PrivateInFinalClassRuleTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,13 @@ public function testPrivateInFinalClassRule(): void
),
11,
],
[
\sprintf(
'Method %s::method() is protected, but since the containing class is final, it can be private.',
Test\Fixture\Methods\PrivateInFinalClassRule\FinalClassOverridingProtectedMethodFromTrait::class,
),
11,
],
[
\sprintf(
'Method %s::method() is protected, but since the containing class is final, it can be private.',
Expand Down

0 comments on commit 2193f14

Please sign in to comment.