Skip to content

Commit

Permalink
Merge pull request #715 from ergebnis/fix/private-in-final-class
Browse files Browse the repository at this point in the history
Fix: Add test case
  • Loading branch information
localheinz committed Jan 23, 2024
2 parents 18154dc + 6cd556c commit a6a8ba8
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<?php

declare(strict_types=1);

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

final class FinalClassWithProtectedMethodFromTrait
{
use TraitWithProtectedMethod;
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
<?php

declare(strict_types=1);

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

trait TraitWithProtectedMethod
{
protected function method(): void
{
}
}
1 change: 1 addition & 0 deletions test/Integration/Methods/PrivateInFinalClassRuleTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ public static function provideCasesWhereAnalysisShouldSucceed(): iterable
'final-class-with-private-method' => __DIR__ . '/../../Fixture/Methods/PrivateInFinalClassRule/Success/FinalClassWithPrivateMethod.php',
'final-class-with-protected-method-extending-class-extending-class-with-same-protected-method' => __DIR__ . '/../../Fixture/Methods/PrivateInFinalClassRule/Success/FinalClassWithProtectedMethodExtendingClassExtendingClassWithSameProtectedMethod.php',
'final-class-with-protected-method-extending-class-with-same-protected-method' => __DIR__ . '/../../Fixture/Methods/PrivateInFinalClassRule/Success/FinalClassWithProtectedMethodExtendingClassWithSameProtectedMethod.php',
'final-class-with-protected-method-from-trait' => __DIR__ . '/../../Fixture/Methods/PrivateInFinalClassRule/Success/FinalClassWithProtectedMethodFromTrait.php',
'final-class-with-public-method' => __DIR__ . '/../../Fixture/Methods/PrivateInFinalClassRule/Success/FinalClassWithPublicMethod.php',
];

Expand Down

0 comments on commit a6a8ba8

Please sign in to comment.