22
33namespace Hexadog \MenusManager ;
44
5- use Illuminate \Support \Arr ;
6- use Illuminate \Support \Collection ;
75use Hexadog \MenusManager \Traits \HasItems ;
86use Illuminate \Contracts \Support \Arrayable ;
7+ use Illuminate \Support \Arr ;
8+ use Illuminate \Support \Collection ;
99use Illuminate \Support \Facades \Request ;
1010use Illuminate \Support \Facades \Route ;
1111use Illuminate \Support \Facades \URL ;
@@ -28,13 +28,13 @@ class Item implements Arrayable
2828 * @var array
2929 */
3030 protected $ properties = [
31- 'attributes ' => [],
32- 'icon ' => null ,
33- 'order ' => 9000 ,
34- 'route ' => null ,
35- 'title ' => '' ,
36- 'type ' => 'link ' , // link | divider | header
37- 'url ' => null ,
31+ 'attributes ' => [],
32+ 'icon ' => null ,
33+ 'order ' => 9000 ,
34+ 'route ' => null ,
35+ 'title ' => '' ,
36+ 'type ' => 'link ' , // link | divider | header
37+ 'url ' => null ,
3838 ];
3939
4040 /**
@@ -101,7 +101,7 @@ public function __set($key, $value)
101101 public function asHeader (): Item
102102 {
103103 return $ this ->fill ([
104- 'type ' => 'header '
104+ 'type ' => 'header ' ,
105105 ]);
106106 }
107107
@@ -113,7 +113,7 @@ public function asHeader(): Item
113113 public function asDivider (): Item
114114 {
115115 return $ this ->fill ([
116- 'type ' => 'divider '
116+ 'type ' => 'divider ' ,
117117 ]);
118118 }
119119
@@ -194,11 +194,11 @@ public function hasChildren(): bool
194194 /**
195195 * Check if icon is set for the current item
196196 *
197- * @return boolean
197+ * @return bool
198198 */
199199 public function hasIcon (): bool
200200 {
201- return !is_null ($ this ->icon );
201+ return ! is_null ($ this ->icon );
202202 }
203203
204204 /**
@@ -251,7 +251,7 @@ public function isHeader(): bool
251251 */
252252 public function isHidden (): bool
253253 {
254- return !$ this ->isVisible ();
254+ return ! $ this ->isVisible ();
255255 }
256256
257257 /**
@@ -289,7 +289,7 @@ public function icon(string $icon): Item
289289 */
290290 public function if ($ callback ): Item
291291 {
292- if (!is_callable ($ callback )) {
292+ if (! is_callable ($ callback )) {
293293 $ callback = function () use ($ callback ) {
294294 return $ callback ;
295295 };
@@ -303,7 +303,7 @@ public function if($callback): Item
303303 /**
304304 * Set the current item order
305305 *
306- * @param integer $order
306+ * @param int $order
307307 *
308308 * @return Item
309309 */
@@ -367,6 +367,7 @@ private function htmlAttributes($attributes)
367367 if (is_bool ($ attributes [$ key ])) {
368368 return $ attributes [$ key ] ? $ key : '' ;
369369 }
370+
370371 return $ key . '=" ' . $ attributes [$ key ] . '" ' ;
371372 }, array_keys ($ attributes ))));
372373 }
@@ -386,7 +387,7 @@ public function toArray()
386387 'order ' => $ this ->order ,
387388 'title ' => $ this ->title ,
388389 'type ' => $ this ->type ,
389- 'url ' => $ this ->getUrl ()
390+ 'url ' => $ this ->getUrl (),
390391 ];
391392 }
392393}
0 commit comments