Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[PHP 8.0] Add return type support to ConstantListClassToEnumRector (#…
…2420) * add return type support * lock to last stable phpstan * [ci-review] Rector Rectify * [ci-review] Rector Rectify Co-authored-by: GitHub Action <action@github.com>
- Loading branch information
1 parent
e368dab
commit 7722a57
Showing
6 changed files
with
112 additions
and
33 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
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
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
34 changes: 34 additions & 0 deletions
34
...ests/Php80/Rector/Class_/ConstantListClassToEnumRector/Fixture/change_return_type.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,34 @@ | ||
<?php | ||
|
||
namespace Rector\Tests\Php80\Rector\Class_\ConstantListClassToEnumRector\Fixture; | ||
|
||
use Rector\Tests\Php80\Rector\Class_\ConstantListClassToEnumRector\Source\Gear; | ||
|
||
final class ChangeReturnType | ||
{ | ||
/** | ||
* @return Gear::* $gear | ||
*/ | ||
public function changeGear(): string | ||
{ | ||
return Gear::FIRST; | ||
} | ||
} | ||
|
||
?> | ||
----- | ||
<?php | ||
|
||
namespace Rector\Tests\Php80\Rector\Class_\ConstantListClassToEnumRector\Fixture; | ||
|
||
use Rector\Tests\Php80\Rector\Class_\ConstantListClassToEnumRector\Source\Gear; | ||
|
||
final class ChangeReturnType | ||
{ | ||
public function changeGear(): \Rector\Tests\Php80\Rector\Class_\ConstantListClassToEnumRector\Source\Gear | ||
{ | ||
return Gear::FIRST; | ||
} | ||
} | ||
|
||
?> |
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
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