File tree Expand file tree Collapse file tree 2 files changed +17
-2
lines changed
rules-tests/DowngradePhp80/Rector/FuncCall/DowngradeSubstrFalsyRector/Fixture
rules/DowngradePhp80/Rector/FuncCall Expand file tree Collapse file tree 2 files changed +17
-2
lines changed Original file line number Diff line number Diff line change 1+ <?php
2+
3+ namespace Rector \Tests \DowngradePhp80 \Rector \FuncCall \DowngradeSubstrFalsyRector \Fixture ;
4+
5+ class SkipAppend
6+ {
7+ public function run (string $ a )
8+ {
9+ $ a .=substr ('a ' , 2 );
10+
11+ return $ a ;
12+ }
13+ }
Original file line number Diff line number Diff line change 77use PhpParser \Node ;
88use PhpParser \Node \Arg ;
99use PhpParser \Node \Expr ;
10+ use PhpParser \Node \Expr \AssignOp ;
1011use PhpParser \Node \Expr \BinaryOp \Concat ;
1112use PhpParser \Node \Expr \BinaryOp \Identical ;
1213use PhpParser \Node \Expr \BooleanNot ;
@@ -69,16 +70,17 @@ public function getNodeTypes(): array
6970 Concat::class,
7071 MethodCall::class,
7172 StaticCall::class,
73+ AssignOp::class,
7274 FuncCall::class,
7375 ];
7476 }
7577
7678 /**
77- * @param Cast|Empty_|BooleanNot|Ternary|Identical|Concat|MethodCall|StaticCall|FuncCall $node
79+ * @param Cast|Empty_|BooleanNot|Ternary|Identical|Concat|MethodCall|StaticCall|AssignOp| FuncCall $node
7880 */
7981 public function refactor (Node $ node ): ?Node
8082 {
81- if ($ node instanceof Cast || $ node instanceof Empty_ || $ node instanceof BooleanNot) {
83+ if ($ node instanceof Cast || $ node instanceof Empty_ || $ node instanceof BooleanNot || $ node instanceof AssignOp ) {
8284 $ node ->expr ->setAttribute (self ::IS_UNCASTABLE , true );
8385 return null ;
8486 }
You can’t perform that action at this time.
0 commit comments