@@ -138,7 +138,7 @@ discard block |
||
138 | 138 | * Register new child menu with dropdown. |
139 | 139 | * |
140 | 140 | * @param $title |
141 | - * @param callable $callback |
|
141 | + * @param Closure $callback |
|
142 | 142 | * |
143 | 143 | * @return $this |
144 | 144 | */ |
@@ -172,7 +172,7 @@ discard block |
||
172 | 172 | * @param array $parameters |
173 | 173 | * @param array $attributes |
174 | 174 | * |
175 | - * @return array |
|
175 | + * @return MenuItem |
|
176 | 176 | */ |
177 | 177 | public function route($route, $title, $parameters = array(), $order = 0, $attributes = array()) |
178 | 178 | { |
@@ -198,7 +198,7 @@ discard block |
||
198 | 198 | * @param $title |
199 | 199 | * @param array $attributes |
200 | 200 | * |
201 | - * @return array |
|
201 | + * @return MenuItem |
|
202 | 202 | */ |
203 | 203 | public function url($url, $title, $order = 0, $attributes = array()) |
204 | 204 | { |
@@ -383,7 +383,7 @@ discard block |
||
383 | 383 | /** |
384 | 384 | * Check is the current item divider. |
385 | 385 | * |
386 | - * @param $name |
|
386 | + * @param string $name |
|
387 | 387 | * |
388 | 388 | * @return bool |
389 | 389 | */ |
@@ -415,7 +415,7 @@ discard block |
||
415 | 415 | /** |
416 | 416 | * Check the active state for current menu. |
417 | 417 | * |
418 | - * @return mixed |
|
418 | + * @return boolean |
|
419 | 419 | */ |
420 | 420 | public function hasActiveOnChild() |
421 | 421 | { |
@@ -567,7 +567,7 @@ discard block |
||
567 | 567 | * Set hide condition for current menu item. |
568 | 568 | * |
569 | 569 | * @param Closure |
570 | - * @return boolean |
|
570 | + * @return MenuItem |
|
571 | 571 | */ |
572 | 572 | public function hideWhen(Closure $callback) |
573 | 573 | { |
@@ -296,7 +296,7 @@ |
||
296 | 296 | public function getChilds() |
297 | 297 | { |
298 | 298 | if (config('menus.ordering')) { |
299 | - return collect($this->childs)->sortBy(function ($child) { |
|
299 | + return collect($this->childs)->sortBy(function($child) { |
|
300 | 300 | return $child->order; |
301 | 301 | })->all(); |
302 | 302 | } |
@@ -42,6 +42,7 @@ discard block |
||
42 | 42 | |
43 | 43 | /** |
44 | 44 | * {@inheritdoc }. |
45 | + * @param \Nwidart\Menus\MenuItem $item |
|
45 | 46 | */ |
46 | 47 | public function getActiveState($item, $state = ' class="active"') |
47 | 48 | { |
@@ -51,7 +52,7 @@ discard block |
||
51 | 52 | /** |
52 | 53 | * Get active state on child items. |
53 | 54 | * |
54 | - * @param $item |
|
55 | + * @param \Nwidart\Menus\MenuItem $item |
|
55 | 56 | * @param string $state |
56 | 57 | * |
57 | 58 | * @return null|string |
@@ -20,7 +20,7 @@ |
||
20 | 20 | /** @test */ |
21 | 21 | public function it_generates_an_empty_menu() |
22 | 22 | { |
23 | - $this->menu->create('test', function (MenuBuilder $menu) { |
|
23 | + $this->menu->create('test', function(MenuBuilder $menu) { |
|
24 | 24 | }); |
25 | 25 | |
26 | 26 | $expected = <<<TEXT |
@@ -119,7 +119,7 @@ discard block |
||
119 | 119 | */ |
120 | 120 | public function findBy($key, $value) |
121 | 121 | { |
122 | - return collect($this->items)->filter(function ($item) use ($key, $value) { |
|
122 | + return collect($this->items)->filter(function($item) use ($key, $value) { |
|
123 | 123 | return $item->{$key} == $value; |
124 | 124 | })->first(); |
125 | 125 | } |
@@ -303,7 +303,7 @@ discard block |
||
303 | 303 | */ |
304 | 304 | protected function resolveItems(array &$items) |
305 | 305 | { |
306 | - $resolver = function ($property) { |
|
306 | + $resolver = function($property) { |
|
307 | 307 | return $this->resolve($property) ?: $property; |
308 | 308 | }; |
309 | 309 | |
@@ -607,7 +607,7 @@ discard block |
||
607 | 607 | public function getOrderedItems() |
608 | 608 | { |
609 | 609 | if (config('menus.ordering') || $this->ordering) { |
610 | - return $this->toCollection()->sortBy(function ($item) { |
|
610 | + return $this->toCollection()->sortBy(function($item) { |
|
611 | 611 | return $item->order; |
612 | 612 | })->all(); |
613 | 613 | } |
@@ -220,7 +220,7 @@ discard block |
||
220 | 220 | /** |
221 | 221 | * Determine if the given name in the presenter style. |
222 | 222 | * |
223 | - * @param $name |
|
223 | + * @param string|null $name |
|
224 | 224 | * |
225 | 225 | * @return bool |
226 | 226 | */ |
@@ -244,7 +244,7 @@ discard block |
||
244 | 244 | * |
245 | 245 | * @param $name |
246 | 246 | * |
247 | - * @return mixed |
|
247 | + * @return string |
|
248 | 248 | */ |
249 | 249 | public function getStyle($name) |
250 | 250 | { |
@@ -256,7 +256,7 @@ discard block |
||
256 | 256 | /** |
257 | 257 | * Set new presenter class from given alias name. |
258 | 258 | * |
259 | - * @param $name |
|
259 | + * @param string|null $name |
|
260 | 260 | */ |
261 | 261 | public function setPresenterFromStyle($name) |
262 | 262 | { |
@@ -339,10 +339,10 @@ discard block |
||
339 | 339 | * Create new menu with dropdown. |
340 | 340 | * |
341 | 341 | * @param $title |
342 | - * @param callable $callback |
|
342 | + * @param \Closure $callback |
|
343 | 343 | * @param array $attributes |
344 | 344 | * |
345 | - * @return $this |
|
345 | + * @return MenuItem |
|
346 | 346 | */ |
347 | 347 | public function dropdown($title, \Closure $callback, $order = null, array $attributes = array()) |
348 | 348 | { |
@@ -374,7 +374,7 @@ discard block |
||
374 | 374 | * @param array $parameters |
375 | 375 | * @param array $attributes |
376 | 376 | * |
377 | - * @return static |
|
377 | + * @return MenuItem |
|
378 | 378 | */ |
379 | 379 | public function route($route, $title, $parameters = array(), $order = null, $attributes = array()) |
380 | 380 | { |
@@ -416,11 +416,11 @@ discard block |
||
416 | 416 | /** |
417 | 417 | * Register new menu item using url. |
418 | 418 | * |
419 | - * @param $url |
|
420 | - * @param $title |
|
419 | + * @param string $url |
|
420 | + * @param string $title |
|
421 | 421 | * @param array $attributes |
422 | 422 | * |
423 | - * @return static |
|
423 | + * @return MenuItem |
|
424 | 424 | */ |
425 | 425 | public function url($url, $title, $order = 0, $attributes = array()) |
426 | 426 | { |
@@ -447,7 +447,7 @@ discard block |
||
447 | 447 | * Add new divider item. |
448 | 448 | * |
449 | 449 | * @param int $order |
450 | - * @return \Nwidart\Menus\MenuItem |
|
450 | + * @return MenuBuilder |
|
451 | 451 | */ |
452 | 452 | public function addDivider($order = null) |
453 | 453 | { |
@@ -459,7 +459,8 @@ discard block |
||
459 | 459 | /** |
460 | 460 | * Add new header item. |
461 | 461 | * |
462 | - * @return \Nwidart\Menus\MenuItem |
|
462 | + * @param string $title |
|
463 | + * @return MenuBuilder |
|
463 | 464 | */ |
464 | 465 | public function addHeader($title, $order = null) |
465 | 466 | { |
@@ -543,6 +544,7 @@ discard block |
||
543 | 544 | /** |
544 | 545 | * Render menu via view presenter. |
545 | 546 | * |
547 | + * @param string $presenter |
|
546 | 548 | * @return \Illuminate\View\View |
547 | 549 | */ |
548 | 550 | public function renderView($presenter = null) |
@@ -93,7 +93,7 @@ |
||
93 | 93 | */ |
94 | 94 | public function modify($name, Closure $callback) |
95 | 95 | { |
96 | - $menu = collect($this->menus)->filter(function ($menu) use ($name) { |
|
96 | + $menu = collect($this->menus)->filter(function($menu) use ($name) { |
|
97 | 97 | return $menu->getName() == $name; |
98 | 98 | })->first(); |
99 | 99 |
@@ -40,7 +40,7 @@ |
||
40 | 40 | { |
41 | 41 | $this->registerHtmlPackage(); |
42 | 42 | |
43 | - $this->app['menus'] = $this->app->share(function ($app) { |
|
43 | + $this->app['menus'] = $this->app->share(function($app) { |
|
44 | 44 | return new Menu($app['view'], $app['config']); |
45 | 45 | }); |
46 | 46 | } |
@@ -42,6 +42,7 @@ discard block |
||
42 | 42 | |
43 | 43 | /** |
44 | 44 | * {@inheritdoc }. |
45 | + * @param \Nwidart\Menus\MenuItem $item |
|
45 | 46 | */ |
46 | 47 | public function getActiveState($item, $state = ' class="active"') |
47 | 48 | { |
@@ -51,7 +52,7 @@ discard block |
||
51 | 52 | /** |
52 | 53 | * Get active state on child items. |
53 | 54 | * |
54 | - * @param $item |
|
55 | + * @param \Nwidart\Menus\MenuItem $item |
|
55 | 56 | * @param string $state |
56 | 57 | * |
57 | 58 | * @return null|string |