File tree Expand file tree Collapse file tree 1 file changed +2
-11
lines changed
rules/DowngradePhp82/Rector/FuncCall Expand file tree Collapse file tree 1 file changed +2
-11
lines changed Original file line number Diff line number Diff line change 66
77use PhpParser \Node ;
88use PhpParser \Node \Arg ;
9- use PhpParser \Node \Expr ;
109use PhpParser \Node \Expr \FuncCall ;
1110use PhpParser \Node \Expr \New_ ;
1211use PhpParser \Node \Expr \Ternary ;
1312use PhpParser \Node \Name \FullyQualified ;
1413use PHPStan \Type \Type ;
15- use PHPStan \Type \UnionType ;
1614use Rector \NodeAnalyzer \ArgsAnalyzer ;
1715use Rector \Rector \AbstractRector ;
1816use Symplify \RuleDocGenerator \ValueObject \CodeSample \CodeSample ;
@@ -87,7 +85,7 @@ public function refactor(Node $node): ?Node
8785 }
8886
8987 $ type = $ this ->nodeTypeResolver ->getType ($ args [0 ]->value );
90- if ($ this ->shouldSkip ($ type, $ args [ 0 ]-> value )) {
88+ if ($ this ->shouldSkip ($ type )) {
9189 return null ;
9290 }
9391
@@ -103,19 +101,12 @@ public function refactor(Node $node): ?Node
103101 return $ node ;
104102 }
105103
106- private function shouldSkip (Type $ type, Expr $ expr ): bool
104+ private function shouldSkip (Type $ type ): bool
107105 {
108- // only array type
109106 if ($ type ->isArray ()->yes ()) {
110107 return false ;
111108 }
112109
113- if ($ type instanceof UnionType) {
114- // possibly already transformed
115- return $ expr instanceof Ternary;
116- }
117-
118- // already has object type check
119110 return $ type ->isObject ()
120111 ->yes ();
121112 }
You can’t perform that action at this time.
0 commit comments