1 | <?php |
||
19 | class Dt extends OpenElement |
||
20 | { |
||
21 | 3 | protected function removeInvalidChildren(LoggerInterface $logger) |
|
22 | { |
||
23 | // No "header", "footer", sectioning content, or heading content descendants. |
||
24 | 3 | foreach ($this->children as $child) { |
|
25 | 3 | if ($child instanceof Header || |
|
26 | 3 | $child instanceof Footer || |
|
27 | 3 | $child instanceof SectioningContent || |
|
28 | 3 | $child instanceof HeadingContent) { |
|
29 | 1 | $logger->debug('Removing ' . $child . '. No "header", "footer", and sectioning content, or heading content elements allowed as children of "dt" element.'); |
|
30 | 1 | $this->removeChild($child); |
|
|
|||
31 | 1 | } |
|
32 | 3 | } |
|
33 | 3 | } |
|
34 | |||
35 | 4 | protected function removeInvalidSelf(LoggerInterface $logger) |
|
48 | } |
||
49 |
If a method or function can return multiple different values and unless you are sure that you only can receive a single value in this context, we recommend to add an additional type check:
If this a common case that PHP Analyzer should handle natively, please let us know by opening an issue.