Skip to content

Commit

Permalink
skip has return with value inside foreach
Browse files Browse the repository at this point in the history
  • Loading branch information
samsonasik committed Apr 14, 2023
1 parent 48e6e63 commit af6f370
Showing 1 changed file with 17 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
<?php

namespace Rector\Tests\DeadCode\Rector\If_\RemoveUnusedNonEmptyArrayBeforeForeachRector\Fixture;

final class SkipHasReturnWithValueInsideForeach
{
public function run(array $items)
{
if (empty($items)) {
return;
}

foreach ($items as $item) {
return 1;
}
}
}

0 comments on commit af6f370

Please sign in to comment.