Conditions | 6 |
Paths | 3 |
Total Lines | 15 |
Code Lines | 9 |
Lines | 15 |
Ratio | 100 % |
Tests | 10 |
CRAP Score | 6 |
Changes | 0 |
1 | <?php |
||
18 | 3 | View Code Duplication | protected function removeInvalidChildren(LoggerInterface $logger) |
|
|||
19 | { |
||
20 | // Only "dd", "dt", and ScriptSupporting elements allowed. |
||
21 | 3 | foreach ($this->children as $child) { |
|
22 | 3 | if ($child instanceof NonParticipating || |
|
23 | 3 | $child instanceof Dd || |
|
24 | 3 | $child instanceof Dt || |
|
25 | 3 | $child instanceof ScriptSupporting) { |
|
26 | 3 | continue; |
|
27 | } |
||
28 | |||
29 | 1 | $logger->debug('Removing ' . $child . '. Only elements "dd", "dt", and script supporting elements allowed as children of "dl" element.'); |
|
30 | 1 | $this->removeChild($child); |
|
31 | } |
||
32 | 3 | } |
|
33 | } |
||
34 |
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.