| Conditions | 7 |
| Paths | 5 |
| Total Lines | 26 |
| Code Lines | 12 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 5 |
| CRAP Score | 18.42 |
| Changes | 1 | ||
| Bugs | 0 | Features | 1 |
| 1 | <?php |
||
| 40 | 1 | protected function doClean(LoggerInterface $logger) |
|
| 41 | { |
||
| 42 | // Only allowed: |
||
| 43 | // Inside ol elements. |
||
| 44 | // Inside ul elements. |
||
| 45 | // Inside menu elements whose type attribute is in the toolbar state. |
||
| 46 | 1 | $parent = $this->getParent(); |
|
| 47 | 1 | if ($parent === null) { |
|
| 48 | return true; |
||
| 49 | } |
||
| 50 | |||
| 51 | 1 | if ($parent->getName() == 'ol' || $parent->getName() == 'ul') { |
|
| 52 | 1 | return true; |
|
| 53 | } |
||
| 54 | |||
| 55 | if ($parent->getName() == 'menu' && $parent->hasAttribute('type')) { |
||
| 56 | $typeAttributeValue = $parent->getAttribute('type'); |
||
|
|
|||
| 57 | if ($typeAttributeValue == 'toolbar') { |
||
| 58 | return true; |
||
| 59 | } |
||
| 60 | } |
||
| 61 | |||
| 62 | $logger->debug('Element "li" only allowed inside "ol", "ul" and "menu[type=toolbar]" elements.'); |
||
| 63 | |||
| 64 | return false; |
||
| 65 | } |
||
| 66 | } |
||
| 67 |
This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.
This is most likely a typographical error or the method has been renamed.