| Conditions | 4 |
| Paths | 3 |
| Total Lines | 16 |
| Code Lines | 9 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 9 |
| CRAP Score | 4 |
| Changes | 0 | ||
| 1 | <?php |
||
| 18 | 4 | public function clean(LoggerInterface $logger) : bool |
|
| 19 | { |
||
| 20 | 4 | $cleanStrategyConfiguration = $this->configuration->get('clean-strategy'); |
|
| 21 | 4 | if ($cleanStrategyConfiguration === Configuration::CLEAN_STRATEGY_NONE || |
|
| 22 | 4 | $cleanStrategyConfiguration === Configuration::CLEAN_STRATEGY_LENIENT) { |
|
| 23 | 4 | return true; |
|
| 24 | } |
||
| 25 | |||
| 26 | // DocType must not have any parent elements. |
||
| 27 | 3 | $result = $this->getParent() === null; |
|
| 28 | 3 | if (!$result) { |
|
| 29 | 1 | $logger->debug('Removing ' . $this . '. DocType cannot be a child of any element.'); |
|
| 30 | } |
||
| 31 | |||
| 32 | 3 | return $result; |
|
| 33 | } |
||
| 34 | |||
| 43 |