We could not synchronize checks via GitHub's checks API since Scrutinizer's GitHub App is not installed for this repository.
| Conditions | 3 |
| Paths | 3 |
| Total Lines | 16 |
| Code Lines | 7 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 45 | protected function generateNav(Collection $repository) |
||
| 46 | { |
||
| 47 | $collection = new Collection; |
||
| 48 | |||
| 49 | /** @var Menu $item */ |
||
| 50 | foreach ($repository as $item) { |
||
| 51 | $collection->put($item->title, $parent = $this->makeNavItem($item)); |
||
| 52 | |||
| 53 | /* @var NavItem $parent */ |
||
| 54 | foreach ($item->children as $new) { |
||
| 55 | $parent->addChild($this->makeNavItem($new)); |
||
|
|
|||
| 56 | } |
||
| 57 | } |
||
| 58 | |||
| 59 | return $this->collection = $collection; |
||
| 60 | } |
||
| 61 | |||
| 95 |
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: