1 | <?php |
||
10 | class Menu |
||
11 | { |
||
12 | /** |
||
13 | * The unique name used to identify a `Menu` instance. |
||
14 | * |
||
15 | * @var string |
||
16 | */ |
||
17 | protected $name; |
||
18 | |||
19 | /** |
||
20 | * The menu's items. |
||
21 | * |
||
22 | * @var Collection |
||
23 | */ |
||
24 | protected $items; |
||
25 | |||
26 | /** |
||
27 | * Any configuration options for the menu. |
||
28 | * |
||
29 | * @var array |
||
30 | */ |
||
31 | protected $config; |
||
32 | |||
33 | /** |
||
34 | * The incoming `Request` object. |
||
35 | * |
||
36 | * @var Request |
||
37 | */ |
||
38 | protected $request; |
||
39 | |||
40 | /** |
||
41 | * An instance of `UrlGenerator` used to generate any URLs for the menu items. |
||
42 | * |
||
43 | * @var UrlGenerator |
||
44 | */ |
||
45 | protected $generator; |
||
46 | |||
47 | /** |
||
48 | * The `Factory` instance used to generate the views. |
||
49 | * |
||
50 | * @var Factory |
||
51 | */ |
||
52 | protected $viewFactory; |
||
53 | |||
54 | /** |
||
55 | * Create a new `Menu` instance. |
||
56 | * |
||
57 | * @param string $name |
||
58 | * @param array $items |
||
59 | * @param array $config |
||
60 | * @param UrlGenerator $generator |
||
61 | * @param Factory $viewFactory |
||
62 | */ |
||
63 | 24 | public function __construct( |
|
79 | |||
80 | /** |
||
81 | * Return name of `Menu` instance. |
||
82 | * |
||
83 | * @return string |
||
84 | */ |
||
85 | 4 | public function getName() |
|
89 | |||
90 | /** |
||
91 | * Returns `Collection` of `Item` objects. |
||
92 | * |
||
93 | * @return Collection |
||
94 | */ |
||
95 | 12 | public function getItems() |
|
99 | |||
100 | /** |
||
101 | * Adds multiple items to the menu. |
||
102 | * |
||
103 | * @param array $items |
||
104 | */ |
||
105 | 16 | public function addItems(array $items) |
|
109 | |||
110 | /** |
||
111 | * Adds an item to the menu. |
||
112 | * |
||
113 | * @param string $title |
||
114 | * @param array|string $item |
||
115 | */ |
||
116 | 4 | public function addItem($title, $item) |
|
120 | |||
121 | /** |
||
122 | * Renders the menu as a HTML string and returns it. |
||
123 | * |
||
124 | * @return string |
||
125 | */ |
||
126 | 8 | public function toHtml() |
|
132 | |||
133 | /** |
||
134 | * Creates and returns a `Collection` of `Items`. |
||
135 | * |
||
136 | * @param array $items |
||
137 | * |
||
138 | * @return Collection |
||
139 | */ |
||
140 | 16 | protected function createItems(array $items) |
|
148 | |||
149 | /** |
||
150 | * Creates and returns a new instance of `Item`. |
||
151 | * |
||
152 | * @param string $title |
||
153 | * @param array|string $item |
||
154 | * |
||
155 | * @return Item |
||
156 | */ |
||
157 | 12 | protected function createItem($title, $item) |
|
187 | |||
188 | /** |
||
189 | * Checks whether an item is an array and contains one of the following keys: |
||
190 | * |
||
191 | * - `to` |
||
192 | * - `secure` |
||
193 | * - `asset` |
||
194 | * - `route` |
||
195 | * - `action` |
||
196 | * |
||
197 | * @param array|string $item |
||
198 | * |
||
199 | * @return boolean |
||
200 | */ |
||
201 | 20 | protected function isItemArray($item) |
|
206 | |||
207 | /** |
||
208 | * Checks whether an item has a `default` key. |
||
209 | * |
||
210 | * @param array|string $item |
||
211 | * |
||
212 | * @return boolean |
||
213 | */ |
||
214 | 20 | protected function hasNestedItems($item) |
|
218 | |||
219 | /** |
||
220 | * Checks if a provided URL is active or not. |
||
221 | * |
||
222 | * @param string $url |
||
223 | * |
||
224 | * @return boolean |
||
225 | */ |
||
226 | 20 | protected function isUrlActive($url) |
|
231 | |||
232 | /** |
||
233 | * Generates a URL using `UrlGenerator`. If `$item` is a string, then it is |
||
234 | * returned unchanged. If `$item` is an array, the key of the array |
||
235 | * corresponds to a method on the `UrlGenerator` instance, and the value is |
||
236 | * passed as a parameter. |
||
237 | * |
||
238 | * @param array|string $item |
||
239 | * |
||
240 | * @return string |
||
241 | */ |
||
242 | 14 | protected function generateItemUrl($item) |
|
250 | } |
||
251 |
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.