mirror of
https://github.com/rectorphp/rector.git
synced 2025-01-18 05:48:21 +01:00
fixup! [DeadCode] Add RemoveDeadTryCatchRector
This commit is contained in:
parent
af90cba019
commit
1881f534de
@ -0,0 +1,40 @@
|
||||
<?php
|
||||
|
||||
namespace Rector\DeadCode\Tests\Rector\TryCatch\RemoveDeadTryCatchRector\Fixture;
|
||||
|
||||
class MultiLines
|
||||
{
|
||||
public function run()
|
||||
{
|
||||
try {
|
||||
$one = 1;
|
||||
$two = 1;
|
||||
if ($one + $two > 1) {
|
||||
return 155;
|
||||
}
|
||||
}
|
||||
catch (Throwable $throwable) {
|
||||
throw $throwable;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
||||
-----
|
||||
<?php
|
||||
|
||||
namespace Rector\DeadCode\Tests\Rector\TryCatch\RemoveDeadTryCatchRector\Fixture;
|
||||
|
||||
class MultiLines
|
||||
{
|
||||
public function run()
|
||||
{
|
||||
$one = 1;
|
||||
$two = 1;
|
||||
if ($one + $two > 1) {
|
||||
return 155;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
@ -0,0 +1,19 @@
|
||||
<?php
|
||||
|
||||
namespace Rector\DeadCode\Tests\Rector\TryCatch\RemoveDeadTryCatchRector\Fixture;
|
||||
|
||||
use InvalidArgumentException;
|
||||
|
||||
class SkipCatchElse
|
||||
{
|
||||
public function run()
|
||||
{
|
||||
try {
|
||||
$one = 1;
|
||||
}
|
||||
catch (Throwable $throwable) {
|
||||
$throwable = new InvalidArgumentException();
|
||||
throw $throwable;
|
||||
}
|
||||
}
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user