Total Complexity | 5 |
Total Lines | 32 |
Duplicated Lines | 0 % |
Changes | 0 |
1 | <?php |
||
11 | class NodePartial extends Node |
||
12 | { |
||
13 | /** |
||
14 | * What first character to determine if escaped sequence are allowed |
||
15 | * |
||
16 | * @param Node $current The current |
||
17 | * @param array $emptyLines The empty lines |
||
18 | * |
||
19 | * @return boolean true to skip normal Loader process, false to continue |
||
20 | */ |
||
21 | public function specialProcess(Node &$current, array &$emptyLines):bool |
||
22 | { |
||
23 | $parent = $this->getParent(); |
||
24 | $addValue = ltrim($current->raw); |
||
25 | $separator = ' '; |
||
26 | if ($this->raw[-1] === ' ' || $this->raw[-1] === "\n") { |
||
27 | $separator = ''; |
||
28 | } |
||
29 | if ($current instanceof NodeBlank) { |
||
30 | $addValue = "\n"; |
||
31 | $separator = ''; |
||
32 | } |
||
33 | $node = NodeFactory::get($this->raw.$separator.$addValue, $this->line); |
||
34 | $node->indent = null; |
||
35 | $parent->value = null; |
||
36 | $parent->add($node); |
||
37 | return true; |
||
38 | } |
||
39 | |||
40 | public function build(&$parent = null) |
||
43 | } |
||
44 | } |