-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Rules] Skip enum on NarrowPublicClassMethodParamTypeRule (#19)
* Add test for skip Enum * fix test * Fix * rectify * clean up
- Loading branch information
1 parent
35a977b
commit 9388c31
Showing
4 changed files
with
39 additions
and
0 deletions.
There are no files selected for viewing
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
19 changes: 19 additions & 0 deletions
19
tests/Rules/NarrowPublicClassMethodParamTypeRule/Fixture/SkipEnum.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,19 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace Rector\TypePerfect\Tests\Rules\NarrowPublicClassMethodParamTypeRule\Fixture; | ||
|
||
use Rector\TypePerfect\Tests\Rules\NarrowPublicClassMethodParamTypeRule\Source\PickReasonEnum; | ||
|
||
class SkipEnum | ||
{ | ||
public function pick(PickReasonEnum $pickReasonEnum): void | ||
{ | ||
} | ||
|
||
public function run() | ||
{ | ||
$this->pick(PickReasonEnum::BarcodeIssue); | ||
} | ||
} |
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
11 changes: 11 additions & 0 deletions
11
tests/Rules/NarrowPublicClassMethodParamTypeRule/Source/PickReasonEnum.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,11 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace Rector\TypePerfect\Tests\Rules\NarrowPublicClassMethodParamTypeRule\Source; | ||
|
||
enum PickReasonEnum: string | ||
{ | ||
case BarcodeIssue = 'barcode_issue'; | ||
case EmptyLocation = 'empty_location'; | ||
} |