1 | <?php |
||
2 | |||
3 | namespace KyleMassacre\Menus\Presenters\Bootstrap; |
||
4 | |||
5 | use KyleMassacre\Menus\Contracts\MenuItemContract; |
||
6 | |||
7 | class NavbarRightPresenter extends NavbarPresenter |
||
8 | { |
||
9 | /** |
||
10 | * {@inheritdoc} |
||
11 | */ |
||
12 | public function getOpenTagWrapper(): ?string |
||
13 | { |
||
14 | return PHP_EOL . '<ul class="nav navbar-nav navbar-right">' . PHP_EOL; |
||
15 | } |
||
16 | |||
17 | /** |
||
18 | * {@inheritdoc} |
||
19 | */ |
||
20 | public function getMenuWithDropDownWrapper(MenuItemContract $item): ?string |
||
21 | { |
||
22 | return '<li class="dropdown pull-right"> |
||
23 | <a href="#" class="dropdown-toggle" data-toggle="dropdown"> |
||
24 | ' . $item->getIcon() . ' ' . $item->title . ' |
||
0 ignored issues
–
show
The property
title does not exist on KyleMassacre\Menus\Contracts\MenuItemContract . Since you implemented __get , consider adding a @property annotation.
![]() |
|||
25 | <b class="caret"></b> |
||
26 | </a> |
||
27 | <ul class="dropdown-menu"> |
||
28 | ' . $this->getChildMenuItems($item) . ' |
||
29 | </ul> |
||
30 | </li>' |
||
31 | . PHP_EOL; |
||
32 | } |
||
33 | } |
||
34 |
This check compares calls to functions or methods with their respective definitions. If the call has less arguments than are defined, it raises an issue.
If a function is defined several times with a different number of parameters, the check may pick up the wrong definition and report false positives. One codebase where this has been known to happen is Wordpress. Please note the @ignore annotation hint above.