Skip to content

Commit 3d11447

Browse files
committed
[Php81] Add native type on Enum MyCLabsClassToEnumRector and SpatieEnumClassToEnumRector
1 parent 25da77f commit 3d11447

5 files changed

Lines changed: 5 additions & 5 deletions

File tree

rules-tests/Php81/Rector/Class_/MyCLabsClassToEnumRector/Fixture/private_constant_with_static_method.php.inc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ namespace Rector\Tests\Php81\Rector\Class_\MyCLabsClassToEnumRector\Fixture;
2323

2424
use MyCLabs\Enum\Enum;
2525

26-
enum PrivateConstWithStaticMethod
26+
enum PrivateConstWithStaticMethod: string
2727
{
2828
/**
2929
* Some comment

rules-tests/Php81/Rector/Class_/MyCLabsClassToEnumRector/Fixture/some_class.php.inc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ namespace Rector\Tests\Php81\Rector\Class_\MyCLabsClassToEnumRector\Fixture;
2222

2323
use MyCLabs\Enum\Enum;
2424

25-
enum SomeClass
25+
enum SomeClass: string
2626
{
2727
/**
2828
* Some comment

rules-tests/Php81/Rector/Class_/SpatieEnumClassToEnumRector/Fixture/some_class.php.inc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ namespace Rector\Tests\Php81\Rector\Class_\SpatieEnumClassToEnumRector\Fixture;
2121

2222
use Spatie\Enum\Enum;
2323

24-
enum StatusEnum
24+
enum StatusEnum: string
2525
{
2626
case draft = 'draft';
2727
case published = 'published';

rules/Php81/Rector/Class_/MyCLabsClassToEnumRector.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ final class Action extends Enum
4343

4444
,
4545
<<<'CODE_SAMPLE'
46-
enum Action
46+
enum Action: string
4747
{
4848
case VIEW = 'view';
4949
case EDIT = 'edit';

rules/Php81/Rector/Class_/SpatieEnumClassToEnumRector.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ class StatusEnum extends Enum
5151

5252
,
5353
<<<'CODE_SAMPLE'
54-
enum StatusEnum
54+
enum StatusEnum: string
5555
{
5656
case draft = 'draft';
5757
case published = 'published';

0 commit comments

Comments
 (0)