1 | <?php |
||
8 | |||
9 | class SidebarMenuPresenter extends Presenter |
||
10 | { |
||
11 | /** |
||
12 | * Get open tag wrapper. |
||
13 | * |
||
14 | * @return string |
||
15 | */ |
||
16 | public function getOpenTagWrapper(): ?string |
||
17 | { |
||
18 | return '<ul class="nav navbar-nav">'; |
||
19 | } |
||
20 | |||
21 | /** |
||
22 | * Get close tag wrapper. |
||
23 | * |
||
24 | * @return string |
||
25 | */ |
||
26 | public function getCloseTagWrapper(): ?string |
||
27 | { |
||
28 | return '</ul>'; |
||
29 | } |
||
30 | |||
31 | /** |
||
32 | * Get menu tag without dropdown wrapper. |
||
33 | * |
||
34 | * @param MenuItemContract $item |
||
35 | * |
||
36 | * @return string |
||
37 | */ |
||
38 | public function getMenuWithoutDropdownWrapper(MenuItemContract $item): ?string |
||
43 | } |
||
44 | |||
45 | /** |
||
46 | * {@inheritdoc} |
||
47 | */ |
||
48 | public function getActiveState(MenuItemContract $item, string $state = ' class="active"'): mixed |
||
49 | { |
||
50 | return $item->isActive() ? $state : null; |
||
51 | } |
||
52 | |||
53 | /** |
||
54 | * Get active state on child items. |
||
55 | * |
||
56 | * @param MenuItemContract $item |
||
57 | * @param string $state |
||
58 | * |
||
59 | * @return null|string |
||
60 | */ |
||
61 | public function getActiveStateOnChild(MenuItemContract $item, string $state = 'active'): ?string |
||
62 | { |
||
63 | return $item->hasActiveOnChild() ? $state : null; |
||
64 | } |
||
65 | |||
66 | /** |
||
67 | * {@inheritdoc} |
||
68 | */ |
||
69 | public function getDividerWrapper(): ?string |
||
70 | { |
||
71 | return '<li class="divider"></li>'; |
||
72 | } |
||
73 | |||
74 | /** |
||
75 | * {@inheritdoc} |
||
76 | */ |
||
77 | public function getHeaderWrapper(MenuItemContract $item): ?string |
||
78 | { |
||
79 | return '<li class="dropdown-header">' . $item->title . '</li>'; |
||
80 | } |
||
81 | |||
82 | /** |
||
83 | * {@inheritdoc} |
||
84 | */ |
||
85 | public function getMenuWithDropDownWrapper(MenuItemContract $item): ?string |
||
103 | } |
||
104 | |||
105 | /** |
||
106 | * Get multilevel menu wrapper. |
||
107 | * |
||
108 | * @param MenuItemContract $item |
||
109 | * |
||
110 | * @return string |
||
111 | */ |
||
112 | public function getMultiLevelDropdownWrapper(MenuItemContract $item): string |
||
115 | } |
||
116 | } |
||
117 |
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.