Skip to content

Commit

Permalink
add failing fixture throw inside empty
Browse files Browse the repository at this point in the history
  • Loading branch information
samsonasik committed Apr 13, 2023
1 parent f85348c commit 2f298aa
Showing 1 changed file with 19 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
<?php

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

use Exception;

final class SkipIfCheckThrowWithEmpty
{
public function run(array $items)
{
if (empty($items)) {
throw new Exception('items must not be empty');
}

foreach ($items as $item) {
echo $item;
}
}
}

0 comments on commit 2f298aa

Please sign in to comment.