Conditions | 4 |
Paths | 4 |
Total Lines | 14 |
Code Lines | 7 |
Lines | 14 |
Ratio | 100 % |
Tests | 8 |
CRAP Score | 4 |
Changes | 0 |
1 | <?php |
||
16 | 31 | View Code Duplication | protected function removeInvalidChildren(LoggerInterface $logger) |
|
|||
17 | { |
||
18 | // TITLE must contain only non-whitespace text or comments. |
||
19 | 31 | foreach ($this->children as $child) { |
|
20 | 28 | if ($child instanceof NonParticipating) { |
|
21 | 1 | continue; |
|
22 | } |
||
23 | |||
24 | 28 | if (!$child instanceof Text) { |
|
25 | 1 | $logger->debug('Removing ' . $child . '. Only text allowed inside TITLE.'); |
|
26 | 28 | $this->removeChild($child); |
|
27 | } |
||
28 | } |
||
29 | 31 | } |
|
30 | } |
||
31 |
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.