mirror of
https://github.com/rectorphp/rector.git
synced 2024-06-07 03:40:50 +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
22 lines
334 B
PHP
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';
|
|
}
|
|
}
|