-
-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add test fixture for interface require public method to avoid lowerin…
…g visibility (#78)
- Loading branch information
1 parent
ff8fa84
commit 338b243
Showing
4 changed files
with
43 additions
and
1 deletion.
There are no files selected for viewing
24 changes: 24 additions & 0 deletions
24
tests/Rules/LocalOnlyPublicClassMethodRule/Fixture/SkipInterfaceMethod.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace TomasVotruba\UnusedPublic\Tests\Rules\LocalOnlyPublicClassMethodRule\Fixture; | ||
|
||
use Rules\LocalOnlyPublicClassMethodRule\Source\SomeParentWithInterface; | ||
|
||
final class SkipInterfaceMethod implements SomeParentWithInterface | ||
{ | ||
/** | ||
* This method is require by parent interface, | ||
* and should never change visibility | ||
*/ | ||
public function neverReport(): void | ||
{ | ||
$url = $this->publicFormatUrl('a', 'b'); | ||
} | ||
|
||
public function publicFormatUrl($path, $type): string | ||
{ | ||
return ''; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
10 changes: 10 additions & 0 deletions
10
tests/Rules/LocalOnlyPublicClassMethodRule/Source/SomeParentWithInterface.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace Rules\LocalOnlyPublicClassMethodRule\Source; | ||
|
||
interface SomeParentWithInterface | ||
{ | ||
public function neverReport(): void; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters