|
@@ 420-434 (lines=15) @@
|
| 417 |
|
|
| 418 |
|
$current_parent = $this->current_leaf->parent; |
| 419 |
|
|
| 420 |
|
if ($this->current_leaf instanceof ParseTree\CallableTree) { |
| 421 |
|
$new_parent_leaf = new ParseTree\CallableWithReturnTypeTree($current_parent); |
| 422 |
|
$this->current_leaf->parent = $new_parent_leaf; |
| 423 |
|
$new_parent_leaf->children = [$this->current_leaf]; |
| 424 |
|
|
| 425 |
|
if ($current_parent) { |
| 426 |
|
array_pop($current_parent->children); |
| 427 |
|
$current_parent->children[] = $new_parent_leaf; |
| 428 |
|
} else { |
| 429 |
|
$this->parse_tree = $new_parent_leaf; |
| 430 |
|
} |
| 431 |
|
|
| 432 |
|
$this->current_leaf = $new_parent_leaf; |
| 433 |
|
return; |
| 434 |
|
} |
| 435 |
|
|
| 436 |
|
if ($this->current_leaf instanceof ParseTree\MethodTree) { |
| 437 |
|
$new_parent_leaf = new ParseTree\MethodWithReturnTypeTree($current_parent); |
|
@@ 436-450 (lines=15) @@
|
| 433 |
|
return; |
| 434 |
|
} |
| 435 |
|
|
| 436 |
|
if ($this->current_leaf instanceof ParseTree\MethodTree) { |
| 437 |
|
$new_parent_leaf = new ParseTree\MethodWithReturnTypeTree($current_parent); |
| 438 |
|
$this->current_leaf->parent = $new_parent_leaf; |
| 439 |
|
$new_parent_leaf->children = [$this->current_leaf]; |
| 440 |
|
|
| 441 |
|
if ($current_parent) { |
| 442 |
|
array_pop($current_parent->children); |
| 443 |
|
$current_parent->children[] = $new_parent_leaf; |
| 444 |
|
} else { |
| 445 |
|
$this->parse_tree = $new_parent_leaf; |
| 446 |
|
} |
| 447 |
|
|
| 448 |
|
$this->current_leaf = $new_parent_leaf; |
| 449 |
|
return; |
| 450 |
|
} |
| 451 |
|
|
| 452 |
|
if ($current_parent && $current_parent instanceof ParseTree\ObjectLikePropertyTree) { |
| 453 |
|
return; |