Conditions | 4 |
Paths | 2 |
Total Lines | 15 |
Code Lines | 8 |
Lines | 15 |
Ratio | 100 % |
Tests | 8 |
CRAP Score | 4 |
Changes | 2 | ||
Bugs | 1 | Features | 0 |
1 | <?php |
||
33 | 3 | View Code Duplication | protected function removeInvalidSelf(LoggerInterface $logger) |
|
|||
34 | { |
||
35 | // Child of "picture" element. |
||
36 | // Child of media element. |
||
37 | 3 | $parent = $this->getParent(); |
|
38 | 3 | if ($parent !== null && |
|
39 | 3 | !$parent instanceof Picture && |
|
40 | 3 | !$parent instanceof MediaElement) { |
|
41 | 1 | $logger->debug('Removing ' . $this . ' must be a child of "picture" element or a media element.'); |
|
42 | |||
43 | 1 | return true; |
|
44 | } |
||
45 | |||
46 | 2 | return false; |
|
47 | } |
||
48 | } |
||
49 |
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.