-
-
Notifications
You must be signed in to change notification settings - Fork 336
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[PHP 8.1] Extend MyCLabsMethodCallToEnumConstRector with getValue() a…
…nd static call
- Loading branch information
1 parent
aee31ce
commit 8c83d4c
Showing
3 changed files
with
119 additions
and
9 deletions.
There are no files selected for viewing
31 changes: 31 additions & 0 deletions
31
...1/Rector/MethodCall/MyCLabsMethodCallToEnumConstRector/Fixture/static_method_call.php.inc
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,31 @@ | ||
<?php | ||
|
||
namespace Rector\Tests\Php81\Rector\MethodCall\MyCLabsMethodCallToEnumConstRector\Fixture; | ||
|
||
use Rector\Tests\Php81\Rector\MethodCall\MyCLabsMethodCallToEnumConstRector\Source\SomeEnum; | ||
|
||
final class StaticMethodCall | ||
{ | ||
public function run($value) | ||
{ | ||
$compare = SomeEnum::VALUE(); | ||
} | ||
} | ||
|
||
?> | ||
----- | ||
<?php | ||
|
||
namespace Rector\Tests\Php81\Rector\MethodCall\MyCLabsMethodCallToEnumConstRector\Fixture; | ||
|
||
use Rector\Tests\Php81\Rector\MethodCall\MyCLabsMethodCallToEnumConstRector\Source\SomeEnum; | ||
|
||
final class StaticMethodCall | ||
{ | ||
public function run($value) | ||
{ | ||
$compare = \Rector\Tests\Php81\Rector\MethodCall\MyCLabsMethodCallToEnumConstRector\Source\SomeEnum::VALUE; | ||
} | ||
} | ||
|
||
?> |
31 changes: 31 additions & 0 deletions
31
...tor/MethodCall/MyCLabsMethodCallToEnumConstRector/Fixture/usage_of_constant_value.php.inc
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,31 @@ | ||
<?php | ||
|
||
namespace Rector\Tests\Php81\Rector\MethodCall\MyCLabsMethodCallToEnumConstRector\Fixture; | ||
|
||
use Rector\Tests\Php81\Rector\MethodCall\MyCLabsMethodCallToEnumConstRector\Source\SomeEnum; | ||
|
||
final class UsageOfConstantValue | ||
{ | ||
public function run($value) | ||
{ | ||
$compare = SomeEnum::VALUE()->getValue(); | ||
} | ||
} | ||
|
||
?> | ||
----- | ||
<?php | ||
|
||
namespace Rector\Tests\Php81\Rector\MethodCall\MyCLabsMethodCallToEnumConstRector\Fixture; | ||
|
||
use Rector\Tests\Php81\Rector\MethodCall\MyCLabsMethodCallToEnumConstRector\Source\SomeEnum; | ||
|
||
final class UsageOfConstantValue | ||
{ | ||
public function run($value) | ||
{ | ||
$compare = \Rector\Tests\Php81\Rector\MethodCall\MyCLabsMethodCallToEnumConstRector\Source\SomeEnum::VALUE->value; | ||
} | ||
} | ||
|
||
?> |
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