| Conditions | 6 |
| Paths | 5 |
| Total Lines | 19 |
| Code Lines | 10 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 13 |
| CRAP Score | 6 |
| Changes | 2 | ||
| Bugs | 1 | Features | 1 |
| 1 | <?php |
||
| 13 | 16 | protected function doClean(LoggerInterface $logger = null) |
|
| 14 | { |
||
| 15 | // TITLE must contain only non-whitespace text. |
||
| 16 | 16 | foreach ($this->children as $child) { |
|
| 17 | 14 | if ($child->getType() == Token::COMMENT) { |
|
| 18 | 1 | continue; |
|
| 19 | } |
||
| 20 | |||
| 21 | 14 | if ($child->getType() != Token::TEXT && |
|
| 22 | 14 | $this->configuration->get('clean-strategy') != Configuration::CLEAN_STRATEGY_LENIENT) { |
|
| 23 | 1 | $this->removeChild($child); |
|
| 24 | 1 | if ($logger !== null) { |
|
| 25 | 1 | $logger->debug('Removing ' . $child . '. Only text allowed inside TITLE.'); |
|
| 26 | 1 | } |
|
| 27 | 1 | } |
|
| 28 | 16 | } |
|
| 29 | |||
| 30 | 16 | return true; |
|
| 31 | } |
||
| 32 | } |
||
| 33 |