rector/rules-tests/DeadCode/Rector/Stmt/RemoveUnreachableStatementRector/Fixture/skip_side_effect_not_return_early.php.inc
Abdul Malik Ikhsan e5c94a20cf
[DeadCode] Handle skipped RemoveUnreachableStatementRector on MultiDirnameRector (#2129)
* [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
2022-04-23 01:00:40 +02:00

22 lines
334 B
PHP

<?php
namespace Rector\Tests\DeadCode\Rector\Stmt\RemoveUnreachableStatementRector\Fixture;
class SkipSideEffectNotReturnEarly
{
public function run()
{
$this->value = 1;
if ($this->sideEffect()) {
}
if ($this->value === 1) {
return 'a';
}
return 'b';
}
}