|
9 | 9 | use PhpParser\Node\Expr; |
10 | 10 | use PhpParser\Node\Expr\Assign; |
11 | 11 | use PhpParser\Node\Expr\BinaryOp\Pipe; |
12 | | -use PhpParser\Node\Expr\Cast\Array_; |
13 | | -use PhpParser\Node\Expr\Cast\String_; |
14 | | -use PhpParser\Node\Expr\ConstFetch; |
15 | 12 | use PhpParser\Node\Expr\FuncCall; |
16 | 13 | use PhpParser\Node\Expr\Variable; |
17 | | -use PhpParser\Node\Scalar\Float_; |
18 | | -use PhpParser\Node\Scalar\Int_; |
19 | 14 | use PhpParser\Node\Stmt; |
20 | 15 | use PhpParser\Node\Stmt\Expression; |
21 | 16 | use PhpParser\Node\VariadicPlaceholder; |
@@ -161,7 +156,7 @@ private function findAssignmentChain(array $statements, int $startIndex): ?array |
161 | 156 | if ($currentIndex === $startIndex) { |
162 | 157 |
|
163 | 158 | // First in chain - must be a variable or simple value |
164 | | - if (! $arg->value instanceof Variable && ! $this->isSimpleValue($arg->value)) { |
| 159 | + if (! $arg->value instanceof Variable && ! $this->exprAnalyzer->isDynamicExpr($arg->value)) { |
165 | 160 | return null; |
166 | 161 | } |
167 | 162 |
|
@@ -192,18 +187,6 @@ private function findAssignmentChain(array $statements, int $startIndex): ?array |
192 | 187 | return $chain; |
193 | 188 | } |
194 | 189 |
|
195 | | - private function isSimpleValue(Expr $expr): bool |
196 | | - { |
197 | | - if ($expr instanceof Array_) { |
198 | | - return ! $this->exprAnalyzer->isDynamicExpr($expr); |
199 | | - } |
200 | | - |
201 | | - return $expr instanceof ConstFetch |
202 | | - || $expr instanceof String_ |
203 | | - || $expr instanceof Float_ |
204 | | - || $expr instanceof Int_; |
205 | | - } |
206 | | - |
207 | 190 | /** |
208 | 191 | * @param array<int, array{stmt: Stmt, assign: Expr, funcCall: Expr\FuncCall}> $chain |
209 | 192 | */ |
|
0 commit comments