| Conditions | 4 |
| Paths | 3 |
| Total Lines | 13 |
| Code Lines | 5 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 44 | protected function normalizeElement(DOMElement $element) |
||
| 45 | { |
||
| 46 | // If this node's content is whitespace, ensure it's preceded or followed by a text node |
||
| 47 | if (trim($element->textContent) === '') |
||
| 48 | { |
||
| 49 | if (!$this->isFollowedByText($element) && !$this->isPrecededByText($element)) |
||
| 50 | { |
||
| 51 | // This would become inter-element whitespace, therefore we can't inline |
||
| 52 | return; |
||
| 53 | } |
||
| 54 | } |
||
| 55 | $element->parentNode->replaceChild($this->createTextNode($element->textContent), $element); |
||
| 56 | } |
||
| 57 | } |