mirror of
https://github.com/rectorphp/rector.git
synced 2024-06-07 11:50:51 +00:00
e5c94a20cf
* [DeadCode] Handle skipped RemoveUnreachableStatementRector on MultiDirnameRector * Fixed 🎉 * Fixed 🎉 * add fixture for has side effect not return early * final touch: first stmt is never removed * final touch: back start from - 2 as jump * really final touch: clean up * really final touch: comment * final touch: no - 1 means it already last, so skip early
31 lines
460 B
PHP
31 lines
460 B
PHP
<?php
|
|
|
|
namespace Rector\Tests\DeadCode\Rector\Stmt\RemoveUnreachableStatementRector\Fixture;
|
|
|
|
class SideEffectReturnEarly
|
|
{
|
|
public function run()
|
|
{
|
|
$this->sideEffect();
|
|
return 5;
|
|
|
|
$removeMe = 10;
|
|
}
|
|
}
|
|
|
|
?>
|
|
-----
|
|
<?php
|
|
|
|
namespace Rector\Tests\DeadCode\Rector\Stmt\RemoveUnreachableStatementRector\Fixture;
|
|
|
|
class SideEffectReturnEarly
|
|
{
|
|
public function run()
|
|
{
|
|
$this->sideEffect();
|
|
return 5;
|
|
}
|
|
}
|
|
|
|
?>
|