Skip to content

Commit

Permalink
more fixtures
Browse files Browse the repository at this point in the history
  • Loading branch information
samsonasik committed Nov 27, 2024
1 parent a2671e0 commit e8e1a26
Showing 1 changed file with 47 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
<?php

namespace Rector\Tests\Php80\Rector\Switch_\ChangeSwitchToMatchRector\Fixture;

final class MirrorCommentWithDefaultExceptionWithNextStmt
{
public function run($value)
{
switch ($value) {
case 100:
// comment 0
$statement = 100;
break;

default:
// comment 1
throw new \InvalidArgumentException();
}

// comment 2
return $statement;
}
}

?>
-----
<?php

namespace Rector\Tests\Php80\Rector\Switch_\ChangeSwitchToMatchRector\Fixture;

final class MirrorCommentWithDefaultExceptionWithNextStmt
{
public function run($value)
{
$statement = match ($value) {
// comment 0
100 => 100,
// comment 1
default => throw new \InvalidArgumentException(),
};

// comment 2
return $statement;
}
}

?>

0 comments on commit e8e1a26

Please sign in to comment.