Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[CodeQuality] Move Yield_ and YieldFrom check to SilentVoidResolver (#…
…5759) * [CodeQuality] Move Yield_ and YieldFrom to SilentVoidResolver * [ci-review] Rector Rectify * clean up * clean up * clean up * clean up * clean up * clean up * clean up * clean up * performance: early check with silent void as not use find() usage from Node finder --------- Co-authored-by: GitHub Action <actions@github.com>
- Loading branch information
1 parent
b042152
commit 8874f25
Showing
3 changed files
with
30 additions
and
31 deletions.
There are no files selected for viewing
15 changes: 15 additions & 0 deletions
15
...s/CodeQuality/Rector/ClassMethod/ExplicitReturnNullRector/Fixture/skip_with_yield.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 SkipWithYield | ||
{ | ||
public function run(int $number) | ||
{ | ||
if ($number > 50) { | ||
return 1; | ||
} | ||
|
||
yield 'foo'; | ||
} | ||
} |
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