File tree Expand file tree Collapse file tree 2 files changed +18
-1
lines changed
rules-tests/DowngradePhp80/Rector/FuncCall/DowngradeSubstrFalsyRector/Fixture
rules/DowngradePhp80/Rector/FuncCall Expand file tree Collapse file tree 2 files changed +18
-1
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 SkipNewArgFalsy
6+ {
7+ public function __construct (false |string $ value )
8+ {
9+ }
10+
11+ public function run ()
12+ {
13+ new self (substr ('a ' , 2 ));
14+ }
15+ }
Original file line number Diff line number Diff line change 2020use PhpParser \Node \Expr \Empty_ ;
2121use PhpParser \Node \Expr \FuncCall ;
2222use PhpParser \Node \Expr \MethodCall ;
23+ use PhpParser \Node \Expr \New_ ;
2324use PhpParser \Node \Expr \StaticCall ;
2425use PhpParser \Node \Expr \Ternary ;
2526use PhpParser \Node \Stmt \Do_ ;
@@ -76,6 +77,7 @@ public function getNodeTypes(): array
7677 Concat::class,
7778 MethodCall::class,
7879 StaticCall::class,
80+ New_::class,
7981 AssignOp::class,
8082 If_::class,
8183 While_::class,
@@ -88,7 +90,7 @@ public function getNodeTypes(): array
8890 }
8991
9092 /**
91- * @param Cast|Empty_|BooleanNot|Ternary|Identical|Concat|MethodCall|StaticCall|AssignOp|If_|While_|Do_|ArrayItem|ArrayDimFetch|BinaryOp|FuncCall $node
93+ * @param Cast|Empty_|BooleanNot|Ternary|Identical|Concat|MethodCall|StaticCall|New_| AssignOp|If_|While_|Do_|ArrayItem|ArrayDimFetch|BinaryOp|FuncCall $node
9294 */
9395 public function refactor (Node $ node ): ?Node
9496 {
You can’t perform that action at this time.
0 commit comments