Conditions | 5 |
Paths | 3 |
Total Lines | 17 |
Code Lines | 9 |
Lines | 0 |
Ratio | 0 % |
Tests | 0 |
CRAP Score | 30 |
Changes | 1 | ||
Bugs | 0 | Features | 1 |
1 | <?php |
||
33 | protected function doClean(LoggerInterface $logger) |
||
34 | { |
||
35 | if ($this->configuration->get('clean-strategy') != Configuration::CLEAN_STRATEGY_LENIENT) { |
||
36 | // Child of "picture" element. |
||
37 | // Child of media element. |
||
38 | $parent = $this->getParent(); |
||
39 | if ($parent !== null && |
||
40 | $parent->getName() != 'picture' && |
||
41 | !$parent instanceof MediaElement) { |
||
42 | $logger->debug('Element "picture" must be a child of "picture" element or a media element.'); |
||
43 | |||
44 | return false; |
||
45 | } |
||
46 | } |
||
47 | |||
48 | return true; |
||
49 | } |
||
50 | } |
||
51 |
Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.
You can also find more detailed suggestions in the “Code” section of your repository.