| Conditions | 5 |
| Paths | 3 |
| Total Lines | 14 |
| Code Lines | 8 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 9 |
| CRAP Score | 5 |
| Changes | 0 | ||
| 1 | <?php |
||
| 18 | 2 | protected function removeInvalidChildren(LoggerInterface $logger) |
|
| 19 | { |
||
| 20 | // Only "li" and ScriptSupporting elements allowed. |
||
| 21 | 2 | foreach ($this->children as $child) { |
|
| 22 | 2 | if ($child instanceof NonParticipating || |
|
| 23 | 2 | $child instanceof Li || |
|
| 24 | 2 | $child instanceof ScriptSupporting) { |
|
| 25 | 2 | continue; |
|
| 26 | } |
||
| 27 | |||
| 28 | 1 | $logger->debug('Removing ' . $child . '. Only elements "li" and script supporting elements allowed as children of "ul" element.'); |
|
| 29 | 1 | $this->removeChild($child); |
|
| 30 | } |
||
| 31 | 2 | } |
|
| 32 | } |
||
| 33 |