| Conditions | 6 |
| Paths | 5 |
| Total Lines | 24 |
| Code Lines | 13 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 15 |
| CRAP Score | 6 |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 18 | 3 | protected function removeInvalidChildren(LoggerInterface $logger) |
|
| 19 | { |
||
| 20 | // Children can be "tr" and script supporting elements. |
||
| 21 | 3 | foreach ($this->children as $child) { |
|
| 22 | 3 | if ($child->getType() == Token::COMMENT) { |
|
| 23 | 1 | continue; |
|
| 24 | } |
||
| 25 | |||
| 26 | 3 | if ($child->getType() !== Token::ELEMENT) { |
|
| 27 | 1 | $logger->debug('Removing ' . $child . '. Only elements allowed as children of "thead" element.'); |
|
| 28 | 1 | $this->removeChild($child); |
|
| 29 | |||
| 30 | 1 | continue; |
|
| 31 | } |
||
| 32 | |||
| 33 | 2 | if ($child->getName() == 'tr' || |
|
| 34 | 2 | $child instanceof ScriptSupporting) { |
|
| 35 | 1 | continue; |
|
| 36 | } |
||
| 37 | |||
| 38 | 1 | $logger->debug('Removing ' . $child . '. Only "tr" and script supporting elements allowed as children of "thead" element.'); |
|
| 39 | 1 | $this->removeChild($child); |
|
| 40 | 3 | } |
|
| 41 | 3 | } |
|
| 42 | |||
| 56 |