| Conditions | 6 |
| Paths | 8 |
| Total Lines | 23 |
| Code Lines | 9 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 40 | public function getBreadcrumbs(AbstractNavigationNode $node = null) { |
||
| 41 | |||
| 42 | // Create the breadcrumbs. |
||
| 43 | $breadcrumbs = []; |
||
| 44 | |||
| 45 | // Correct the parameter if necessary. |
||
| 46 | if (is_null($node)) { |
||
| 47 | $node = $this; |
||
| 48 | } |
||
| 49 | |||
| 50 | // Check the instance. |
||
| 51 | if (($node instanceof NavigationNode || $node instanceof BreadcrumbNode) && $node->getActive()) { |
||
| 52 | $breadcrumbs[] = $node; |
||
| 53 | } |
||
| 54 | |||
| 55 | // Handle each node. |
||
| 56 | foreach ($node->getNodes() as $current) { |
||
| 57 | $breadcrumbs = array_merge($breadcrumbs, $this->getBreadcrumbs($current)); |
||
|
|
|||
| 58 | } |
||
| 59 | |||
| 60 | // Return the breadcrumbs. |
||
| 61 | return $breadcrumbs; |
||
| 62 | } |
||
| 63 | |||
| 65 |
It seems like the type of the argument is not accepted by the function/method which you are calling.
In some cases, in particular if PHP’s automatic type-juggling kicks in this might be fine. In other cases, however this might be a bug.
We suggest to add an explicit type cast like in the following example: