-
-
Notifications
You must be signed in to change notification settings - Fork 346
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[TypeDeclaration] AddVoidReturnTypeWhereNoReturnRector turns `@return…
… never` into less specific `@return void` (#1553) * added failling test * fix * added more bottom-type tests * made rector aware of all phpstan supported bottom types * cs Co-authored-by: Markus Staab <m.staab@complex-it.de>
- Loading branch information
Showing
3 changed files
with
58 additions
and
3 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
44 changes: 44 additions & 0 deletions
44
...tor/ClassMethod/AddVoidReturnTypeWhereNoReturnRector/FixtureUsePhpDoc/never-types.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,44 @@ | ||
<?php | ||
|
||
namespace Rector\Tests\TypeDeclaration\Rector\ClassMethod\AddVoidReturnTypeWhereNoReturnRector\Fixture; | ||
|
||
final class SomeClass | ||
{ | ||
/** | ||
* @return never | ||
*/ | ||
public function neverReturn() | ||
{ | ||
header('Location: example.com'); | ||
exit(); | ||
} | ||
|
||
/** | ||
* @return never-return | ||
*/ | ||
public function neverReturn() | ||
{ | ||
header('Location: example.com'); | ||
exit(); | ||
} | ||
|
||
/** | ||
* @return never-returns | ||
*/ | ||
public function neverReturns() | ||
{ | ||
header('Location: example.com'); | ||
exit(); | ||
} | ||
|
||
/** | ||
* @return no-return | ||
*/ | ||
public function noReturn() | ||
{ | ||
header('Location: example.com'); | ||
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