-
-
Notifications
You must be signed in to change notification settings - Fork 339
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[CodeQuality] Skip while(true) always returned on ExplicitReturnNullR…
…ector (#5810) * [CodeQuality] Skip while(true) always returned on ExplicitReturnNullRector * [ci-review] Rector Rectify * [ci-review] Rector Rectify * more fixture * fix --------- Co-authored-by: GitHub Action <actions@github.com>
- Loading branch information
1 parent
b292010
commit 54e2e11
Showing
3 changed files
with
73 additions
and
9 deletions.
There are no files selected for viewing
15 changes: 15 additions & 0 deletions
15
.../ClassMethod/ExplicitReturnNullRector/Fixture/skip_do_whlile_true_always_returned.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,15 @@ | ||
<?php | ||
|
||
namespace Rector\Tests\CodeQuality\Rector\ClassMethod\ExplicitReturnNullRector\Fixture; | ||
|
||
final class SkipDoWhileTrueAlwaysReturned | ||
{ | ||
public function run() | ||
{ | ||
do { | ||
if (mt_rand() === 0) { | ||
return 'yay'; | ||
} | ||
} while (true); | ||
} | ||
} |
15 changes: 15 additions & 0 deletions
15
...ctor/ClassMethod/ExplicitReturnNullRector/Fixture/skip_while_true_always_returned.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,15 @@ | ||
<?php | ||
|
||
namespace Rector\Tests\CodeQuality\Rector\ClassMethod\ExplicitReturnNullRector\Fixture; | ||
|
||
final class SkipWhileTrueAlwaysReturned | ||
{ | ||
public function run() | ||
{ | ||
while (true) { | ||
if (mt_rand() === 0) { | ||
return 'yay'; | ||
} | ||
} | ||
} | ||
} |
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