Total Complexity | 8 |
Total Lines | 35 |
Duplicated Lines | 0 % |
Coverage | 94.12% |
Changes | 0 |
1 | <?php |
||
14 | class Blank extends NodeGeneric |
||
15 | { |
||
16 | 1 | public function add(NodeGeneric $child): NodeGeneric |
|
17 | { |
||
18 | 1 | if ($this->_parent instanceof NodeGeneric) { |
|
19 | 1 | return $this->_parent->add($child); |
|
20 | } else { |
||
21 | throw new \ParseError(__METHOD__ . " no parent to add to", 1); |
||
22 | } |
||
23 | } |
||
24 | |||
25 | 1 | public function specialProcess(NodeGeneric &$previous, array &$emptyLines): bool |
|
26 | { |
||
27 | 1 | $deepest = $previous->getDeepestNode(); |
|
28 | 1 | if ($previous instanceof Scalar) { |
|
29 | 1 | $emptyLines[] = $this->setParent($previous->getParent()); |
|
30 | 1 | } elseif ($deepest instanceof Literals) { |
|
31 | 1 | $emptyLines[] = $this->setParent($deepest); |
|
32 | } |
||
33 | 1 | return true; |
|
34 | } |
||
35 | |||
36 | 1 | public function build(&$parent = null) |
|
37 | { |
||
38 | 1 | return "\n"; |
|
39 | } |
||
40 | |||
41 | 1 | public function getTargetOnEqualIndent(NodeGeneric &$node): ?NodeGeneric |
|
44 | } |
||
45 | |||
46 | 1 | public function getTargetOnMoreIndent(NodeGeneric &$node): ?NodeGeneric |
|
49 | } |
||
50 | } |
||
51 |