| Conditions | 5 |
| Paths | 4 |
| Total Lines | 22 |
| Code Lines | 11 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 31 | protected function normalizeElement(DOMElement $element) |
||
| 32 | { |
||
| 33 | $value = ''; |
||
| 34 | foreach ($element->childNodes as $node) |
||
| 35 | { |
||
| 36 | if ($node instanceof DOMText || $this->isXsl($node, 'text')) |
||
| 37 | { |
||
| 38 | $value .= preg_replace('([{}])', '$0$0', $node->textContent); |
||
| 39 | } |
||
| 40 | elseif ($this->isXsl($node, 'value-of')) |
||
| 41 | { |
||
| 42 | $value .= '{' . $node->getAttribute('select') . '}'; |
||
| 43 | } |
||
| 44 | else |
||
| 45 | { |
||
| 46 | // Can't inline this attribute |
||
| 47 | return; |
||
| 48 | } |
||
| 49 | } |
||
| 50 | $element->parentNode->setAttribute($element->getAttribute('name'), $value); |
||
| 51 | $element->parentNode->removeChild($element); |
||
| 52 | } |
||
| 53 | } |