mirror of
https://github.com/rectorphp/rector.git
synced 2024-06-27 13:13:31 +00:00
Updated Rector to commit 8e6d46a58fff8e6bd5276b9ae473bfb91460b487
8e6d46a58f
[Instanceof] Fix combination of dead instance and compare (#5319)
This commit is contained in:
parent
ab4ff53673
commit
d9834a6d69
|
@ -3,6 +3,8 @@
|
||||||
declare (strict_types=1);
|
declare (strict_types=1);
|
||||||
namespace Rector\DeadCode\Rector\If_;
|
namespace Rector\DeadCode\Rector\If_;
|
||||||
|
|
||||||
|
use PhpParser\Node\Expr\Assign;
|
||||||
|
use PhpParser\Node\Stmt\Expression;
|
||||||
use PhpParser\Node;
|
use PhpParser\Node;
|
||||||
use PhpParser\Node\Expr;
|
use PhpParser\Node\Expr;
|
||||||
use PhpParser\Node\Expr\BooleanNot;
|
use PhpParser\Node\Expr\BooleanNot;
|
||||||
|
@ -98,6 +100,10 @@ CODE_SAMPLE
|
||||||
if ($this->shouldSkipFromNotTypedParam($instanceof)) {
|
if ($this->shouldSkipFromNotTypedParam($instanceof)) {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
if ($instanceof->expr instanceof Assign) {
|
||||||
|
$assignExpression = new Expression($instanceof->expr);
|
||||||
|
return \array_merge([$assignExpression], $if->stmts);
|
||||||
|
}
|
||||||
if ($if->cond !== $instanceof) {
|
if ($if->cond !== $instanceof) {
|
||||||
return NodeTraverser::REMOVE_NODE;
|
return NodeTraverser::REMOVE_NODE;
|
||||||
}
|
}
|
||||||
|
|
|
@ -19,12 +19,12 @@ final class VersionResolver
|
||||||
* @api
|
* @api
|
||||||
* @var string
|
* @var string
|
||||||
*/
|
*/
|
||||||
public const PACKAGE_VERSION = '026398c9e1078cb3ac5cac41767b620872166859';
|
public const PACKAGE_VERSION = '8e6d46a58fff8e6bd5276b9ae473bfb91460b487';
|
||||||
/**
|
/**
|
||||||
* @api
|
* @api
|
||||||
* @var string
|
* @var string
|
||||||
*/
|
*/
|
||||||
public const RELEASE_DATE = '2023-12-03 20:08:03';
|
public const RELEASE_DATE = '2023-12-03 20:10:35';
|
||||||
/**
|
/**
|
||||||
* @var int
|
* @var int
|
||||||
*/
|
*/
|
||||||
|
|
Loading…
Reference in New Issue
Block a user