-
-
Notifications
You must be signed in to change notification settings - Fork 343
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[TypeDeclaration][Php 8.1] Do not skip return on parent anonymous cla…
…ss method (#1403)
- Loading branch information
1 parent
9ca7320
commit b6b0e64
Showing
2 changed files
with
56 additions
and
2 deletions.
There are no files selected for viewing
41 changes: 41 additions & 0 deletions
41
...od/ReturnNeverTypeRector/Fixture/do_not_skip_return_parent_anonymous_class_method.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,41 @@ | ||
<?php | ||
|
||
namespace Rector\Tests\TypeDeclaration\Rector\ClassMethod\ReturnNeverTypeRector\Fixture; | ||
|
||
final class DoNotSkipReturnParentAnonymousClassMethod | ||
{ | ||
public function run() | ||
{ | ||
new class { | ||
public function run() | ||
{ | ||
return; | ||
} | ||
}; | ||
|
||
exit(); | ||
} | ||
} | ||
|
||
?> | ||
----- | ||
<?php | ||
|
||
namespace Rector\Tests\TypeDeclaration\Rector\ClassMethod\ReturnNeverTypeRector\Fixture; | ||
|
||
final class DoNotSkipReturnParentAnonymousClassMethod | ||
{ | ||
public function run(): never | ||
{ | ||
new class { | ||
public function run() | ||
{ | ||
return; | ||
} | ||
}; | ||
|
||
exit(); | ||
} | ||
} | ||
|
||
?> |
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