From 0226b2ea72617ce9d406f983f1a9fd23fa7461cf Mon Sep 17 00:00:00 2001 From: Tomas Votruba Date: Thu, 27 Jun 2024 18:53:09 +0000 Subject: [PATCH] Updated Rector to commit 237e79105fe7e8ef22020c06ee1a456f27dbcf4b https://github.com/rectorphp/rector-src/commit/237e79105fe7e8ef22020c06ee1a456f27dbcf4b fix: Skip remove always true condition on method calls (#6063) --- .../DeadCode/Rector/If_/RemoveAlwaysTrueIfConditionRector.php | 4 +++- src/Application/VersionResolver.php | 4 ++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/rules/DeadCode/Rector/If_/RemoveAlwaysTrueIfConditionRector.php b/rules/DeadCode/Rector/If_/RemoveAlwaysTrueIfConditionRector.php index 7bc87eb4ffb..ba2712ad1b3 100644 --- a/rules/DeadCode/Rector/If_/RemoveAlwaysTrueIfConditionRector.php +++ b/rules/DeadCode/Rector/If_/RemoveAlwaysTrueIfConditionRector.php @@ -8,7 +8,9 @@ use PhpParser\Node\Expr; use PhpParser\Node\Expr\ArrayDimFetch; use PhpParser\Node\Expr\Assign; use PhpParser\Node\Expr\BinaryOp\BooleanAnd; +use PhpParser\Node\Expr\MethodCall; use PhpParser\Node\Expr\PropertyFetch; +use PhpParser\Node\Expr\StaticCall; use PhpParser\Node\Expr\StaticPropertyFetch; use PhpParser\Node\Expr\Variable; use PhpParser\Node\Stmt; @@ -134,7 +136,7 @@ CODE_SAMPLE } private function shouldSkipExpr(Expr $expr) : bool { - return (bool) $this->betterNodeFinder->findInstancesOf($expr, [PropertyFetch::class, StaticPropertyFetch::class, ArrayDimFetch::class]); + return (bool) $this->betterNodeFinder->findInstancesOf($expr, [PropertyFetch::class, StaticPropertyFetch::class, ArrayDimFetch::class, MethodCall::class, StaticCall::class]); } private function refactorIfWithBooleanAnd(If_ $if) : ?If_ { diff --git a/src/Application/VersionResolver.php b/src/Application/VersionResolver.php index 80b9fc0bb55..d8739683c08 100644 --- a/src/Application/VersionResolver.php +++ b/src/Application/VersionResolver.php @@ -19,12 +19,12 @@ final class VersionResolver * @api * @var string */ - public const PACKAGE_VERSION = 'ad8b64c8c158aadddeafa35313e8f5643babda28'; + public const PACKAGE_VERSION = '237e79105fe7e8ef22020c06ee1a456f27dbcf4b'; /** * @api * @var string */ - public const RELEASE_DATE = '2024-06-27 19:57:16'; + public const RELEASE_DATE = '2024-06-27 20:50:41'; /** * @var int */