File tree Expand file tree Collapse file tree
rules/CodeQuality/Rector/If_ Expand file tree Collapse file tree Original file line number Diff line number Diff line change 66use PhpParser \Node ;
77use PhpParser \Node \Expr \BinaryOp ;
88use PhpParser \Node \Expr \BinaryOp \BooleanAnd ;
9+ use PhpParser \Node \Expr \BooleanNot ;
910use PhpParser \Node \Stmt \Else_ ;
1011use PhpParser \Node \Stmt \If_ ;
1112use PHPStan \PhpDocParser \Ast \PhpDoc \VarTagValueNode ;
@@ -93,6 +94,9 @@ public function refactor(Node $node): ?Node
9394 if ($ subIf ->cond instanceof BinaryOp && !$ subIf ->cond ->left instanceof BinaryOp) {
9495 $ subIf ->cond ->left ->setAttribute (AttributeKey::ORIGINAL_NODE , null );
9596 }
97+ if ($ node ->cond instanceof BooleanNot && $ node ->cond ->expr instanceof BinaryOp) {
98+ $ node ->cond ->expr ->setAttribute (AttributeKey::ORIGINAL_NODE , null );
99+ }
96100 $ node ->cond = new BooleanAnd ($ node ->cond , $ subIf ->cond );
97101 $ node ->stmts = $ subIf ->stmts ;
98102 $ this ->commentsMerger ->keepComments ($ node , [$ subIf ]);
Original file line number Diff line number Diff line change @@ -19,12 +19,12 @@ final class VersionResolver
1919 * @api
2020 * @var string
2121 */
22- public const PACKAGE_VERSION = '68156b9da3691ed306f3c2be0eebd8582f14520d ' ;
22+ public const PACKAGE_VERSION = '92104b02a3d0405bc9ef89406ac1552149775428 ' ;
2323 /**
2424 * @api
2525 * @var string
2626 */
27- public const RELEASE_DATE = '2026-03-29 00:56:46 ' ;
27+ public const RELEASE_DATE = '2026-03-30 09:59:03 ' ;
2828 /**
2929 * @var int
3030 */
You can’t perform that action at this time.
0 commit comments