| Conditions | 7 |
| Paths | 3 |
| Total Lines | 22 |
| Code Lines | 16 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 20 | public function getFinalString(NodeList $value, $refIndent = null):string |
||
| 21 | { |
||
| 22 | $result = ''; |
||
| 23 | $list = $value->filterComment(); |
||
| 24 | if (!is_null($list) && $list->count()) { |
||
| 25 | if ($this->identifier !== '+') { |
||
| 26 | self::litteralStripTrailing($list); |
||
| 27 | } |
||
| 28 | $list->setIteratorMode(NodeList::IT_MODE_DELETE); |
||
| 29 | $first = $list->shift(); |
||
| 30 | $indent = $refIndent ?? $first->indent; |
||
| 31 | $result = $this->getChildValue($first, $indent); |
||
| 32 | foreach ($list as $key => $child) { |
||
| 33 | $value = "\n"; |
||
| 34 | if (!($child instanceof NodeBlank)) { |
||
| 35 | $newIndent = $indent > 0 ? $child->indent - $indent : 0; |
||
| 36 | $value .= str_repeat(' ', $newIndent).$this->getChildValue($child, $indent); |
||
| 37 | } |
||
| 38 | $result .= $value; |
||
| 39 | } |
||
| 40 | } |
||
| 41 | return $result; |
||
| 42 | } |
||
| 43 | } |