Conditions | 5 |
Paths | 3 |
Total Lines | 14 |
Code Lines | 8 |
Lines | 14 |
Ratio | 100 % |
Tests | 9 |
CRAP Score | 5 |
Changes | 0 |
1 | <?php |
||
17 | 3 | protected function removeInvalidChildren(LoggerInterface $logger) |
|
18 | { |
||
19 | // Children can be "tr" and script supporting elements. |
||
20 | 3 | foreach ($this->children as $child) { |
|
21 | 3 | if ($child instanceof NonParticipating || |
|
22 | 3 | $child instanceof Tr || |
|
23 | 3 | $child instanceof ScriptSupporting) { |
|
24 | 2 | continue; |
|
25 | } |
||
26 | |||
27 | 2 | $logger->debug('Removing ' . $child . '. Only "tr" and script supporting elements allowed as children of "tfoot" element.'); |
|
28 | 2 | $this->removeChild($child); |
|
29 | } |
||
30 | 3 | } |
|
31 | |||
45 |
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.