-
-
Notifications
You must be signed in to change notification settings - Fork 356
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
a2671e0
commit e8e1a26
Showing
1 changed file
with
47 additions
and
0 deletions.
There are no files selected for viewing
47 changes: 47 additions & 0 deletions
47
...eSwitchToMatchRector/Fixture/mirrow_comment_with_default_exception_with_next_stmt.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,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; | ||
} | ||
} | ||
|
||
?> |