Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
More fixture on Do_ maybe returned (#5767)
- Loading branch information
1 parent
879feb8
commit 11ce9fc
Showing
1 changed file
with
36 additions
and
0 deletions.
There are no files selected for viewing
36 changes: 36 additions & 0 deletions
36
...lity/Rector/ClassMethod/ExplicitReturnNullRector/Fixture/do_while_maybe_returned3.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,36 @@ | ||
<?php | ||
|
||
namespace Rector\Tests\CodeQuality\Rector\ClassMethod\ExplicitReturnNullRector\Fixture; | ||
|
||
final class DoWhileMaybeReturned3 | ||
{ | ||
public function run(int $i) | ||
{ | ||
do { | ||
if (rand(0,1)) { | ||
return 1; | ||
} | ||
} while (++$i < 1); | ||
} | ||
} | ||
|
||
?> | ||
----- | ||
<?php | ||
|
||
namespace Rector\Tests\CodeQuality\Rector\ClassMethod\ExplicitReturnNullRector\Fixture; | ||
|
||
final class DoWhileMaybeReturned3 | ||
{ | ||
public function run(int $i) | ||
{ | ||
do { | ||
if (rand(0,1)) { | ||
return 1; | ||
} | ||
} while (++$i < 1); | ||
return null; | ||
} | ||
} | ||
|
||
?> |