This method seems to be duplicated in your project.
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.
Loading history...
32
{
33
2
foreach ($this->children as $child) {
34
2
if ($child instanceof NonParticipating ||
35
2
$child instanceof Option ||
36
2
$child instanceof ScriptSupporting) {
37
1
continue;
38
}
39
40
1
$logger->debug('Removing ' . $child . '. Only "option" and script supporting elements allowed as children of a "optgroup" element.');
41
1
$this->removeChild($child);
42
}
43
2
}
44
45
3
protected function removeInvalidSelf(LoggerInterface $logger) : bool
46
{
47
3
$parent = $this->getParent();
48
3
if ($parent !== null && !$parent instanceof Select) {
49
1
$logger->debug('Removing ' . $this . '. Only "select" element allowed as parent of "optgroup" element.');
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.