Skip to content

Commit

Permalink
Add test for skip Enum
Browse files Browse the repository at this point in the history
  • Loading branch information
samsonasik committed Jun 17, 2024
1 parent 476f8ee commit 16a9b19
Show file tree
Hide file tree
Showing 4 changed files with 27 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/Rules/NarrowPrivateClassMethodParamTypeRule.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
use Rector\TypePerfect\NodeFinder\MethodCallNodeFinder;

/**
* @see \Rector\TypePerfect\Tests\Rules\CheckTypehintCallerTypeRule\CheckTypehintCallerTypeRuleTest
* @see \Rector\TypePerfect\Tests\Rules\NarrowPrivateClassMethodParamTypeRule\NarrowPrivateClassMethodParamTypeRuleTest
* @implements Rule<MethodCall>
*/
final readonly class NarrowPrivateClassMethodParamTypeRule implements Rule
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
<?php

declare(strict_types=1);

namespace Rector\TypePerfect\Tests\Rules\NarrowPrivateClassMethodParamTypeRule\Fixture;

use Rector\TypePerfect\Tests\Rules\NarrowPrivateClassMethodParamTypeRule\Source\PickReasonEnum;

class SkipEnum
{
public function pick(PickReasonEnum $pickReasonEnum): void
{
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ public static function provideData(): Iterator
yield [__DIR__ . '/Fixture/DoubleShot.php', [[$argErrorMessage, 15], [$paramErrorMessage, 15]]];
yield [__DIR__ . '/Fixture/SkipGenericType.php', []];
yield [__DIR__ . '/Fixture/SkipAbstractBase.php', []];
yield [__DIR__ . '/Fixture/SkipEnum.php', []];
}

/**
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<?php

declare(strict_types=1);

namespace Rector\TypePerfect\Tests\Rules\NarrowPrivateClassMethodParamTypeRule\Source;

enum PickReasonEnum: string
{
case BarcodeIssue = 'barcode_issue';
case EmptyLocation = 'empty_location';
}

0 comments on commit 16a9b19

Please sign in to comment.