@@ -11,7 +11,7 @@ discard block |
||
11 | 11 | */ |
12 | 12 | public function getOpenTagWrapper(): ?string |
13 | 13 | { |
14 | - return PHP_EOL . '<ul class="nav navbar-nav navbar-right">' . PHP_EOL; |
|
14 | + return PHP_EOL.'<ul class="nav navbar-nav navbar-right">'.PHP_EOL; |
|
15 | 15 | } |
16 | 16 | |
17 | 17 | /** |
@@ -21,11 +21,11 @@ discard block |
||
21 | 21 | { |
22 | 22 | return '<li class="dropdown pull-right"> |
23 | 23 | <a href="#" class="dropdown-toggle" data-toggle="dropdown"> |
24 | - ' . $item->getIcon() . ' ' . $item->title . ' |
|
24 | + ' . $item->getIcon().' '.$item->title.' |
|
25 | 25 | <b class="caret"></b> |
26 | 26 | </a> |
27 | 27 | <ul class="dropdown-menu"> |
28 | - ' . $this->getChildMenuItems($item) . ' |
|
28 | + ' . $this->getChildMenuItems($item).' |
|
29 | 29 | </ul> |
30 | 30 | </li>' |
31 | 31 | . PHP_EOL; |
@@ -37,9 +37,9 @@ discard block |
||
37 | 37 | */ |
38 | 38 | public function getMenuWithoutDropdownWrapper(MenuItemContract $item): ?string |
39 | 39 | { |
40 | - return '<li' . $this->getActiveState($item) . '> |
|
41 | - <a href="' . $item->getUrl() . '" ' . $item->getAttributes() . '>' |
|
42 | - . $item->getIcon() . ' ' . $item->title . '</a></li>' . PHP_EOL; |
|
40 | + return '<li'.$this->getActiveState($item).'> |
|
41 | + <a href="' . $item->getUrl().'" '.$item->getAttributes().'>' |
|
42 | + . $item->getIcon().' '.$item->title.'</a></li>'.PHP_EOL; |
|
43 | 43 | } |
44 | 44 | |
45 | 45 | /** |
@@ -76,7 +76,7 @@ discard block |
||
76 | 76 | */ |
77 | 77 | public function getHeaderWrapper(MenuItemContract $item): ?string |
78 | 78 | { |
79 | - return '<li class="dropdown-header">' . $item->title . '</li>'; |
|
79 | + return '<li class="dropdown-header">'.$item->title.'</li>'; |
|
80 | 80 | } |
81 | 81 | |
82 | 82 | /** |
@@ -87,14 +87,14 @@ discard block |
||
87 | 87 | $id = Str::random(); |
88 | 88 | |
89 | 89 | return ' |
90 | - <li class="' . $this->getActiveStateOnChild($item) . ' panel panel-default" id="dropdown"> |
|
91 | - <a data-toggle="collapse" href="#' . $id . '"> |
|
92 | - ' . $item->getIcon() . ' ' . $item->title . ' <span class="caret"></span> |
|
90 | + <li class="' . $this->getActiveStateOnChild($item).' panel panel-default" id="dropdown"> |
|
91 | + <a data-toggle="collapse" href="#' . $id.'"> |
|
92 | + ' . $item->getIcon().' '.$item->title.' <span class="caret"></span> |
|
93 | 93 | </a> |
94 | - <div id="' . $id . '" class="panel-collapse collapse ' . $this->getActiveStateOnChild($item, 'in') . '"> |
|
94 | + <div id="' . $id.'" class="panel-collapse collapse '.$this->getActiveStateOnChild($item, 'in').'"> |
|
95 | 95 | <div class="panel-body"> |
96 | 96 | <ul class="nav navbar-nav"> |
97 | - ' . $this->getChildMenuItems($item) . ' |
|
97 | + ' . $this->getChildMenuItems($item).' |
|
98 | 98 | </ul> |
99 | 99 | </div> |
100 | 100 | </div> |
@@ -12,7 +12,7 @@ discard block |
||
12 | 12 | */ |
13 | 13 | public function getOpenTagWrapper(): ?string |
14 | 14 | { |
15 | - return PHP_EOL . '<ul class="nav navbar-nav">' . PHP_EOL; |
|
15 | + return PHP_EOL.'<ul class="nav navbar-nav">'.PHP_EOL; |
|
16 | 16 | } |
17 | 17 | |
18 | 18 | /** |
@@ -20,7 +20,7 @@ discard block |
||
20 | 20 | */ |
21 | 21 | public function getCloseTagWrapper(): ?string |
22 | 22 | { |
23 | - return PHP_EOL . '</ul>' . PHP_EOL; |
|
23 | + return PHP_EOL.'</ul>'.PHP_EOL; |
|
24 | 24 | } |
25 | 25 | |
26 | 26 | /** |
@@ -28,7 +28,7 @@ discard block |
||
28 | 28 | */ |
29 | 29 | public function getMenuWithoutDropdownWrapper(MenuItemContract $item): ?string |
30 | 30 | { |
31 | - return '<li' . $this->getActiveState($item) . '><a href="' . $item->getUrl() . '" ' . $item->getAttributes() . '>' . $item->getIcon() . ' ' . $item->title . '</a></li>' . PHP_EOL; |
|
31 | + return '<li'.$this->getActiveState($item).'><a href="'.$item->getUrl().'" '.$item->getAttributes().'>'.$item->getIcon().' '.$item->title.'</a></li>'.PHP_EOL; |
|
32 | 32 | } |
33 | 33 | |
34 | 34 | /** |
@@ -65,7 +65,7 @@ discard block |
||
65 | 65 | */ |
66 | 66 | public function getHeaderWrapper(MenuItemContract $item): ?string |
67 | 67 | { |
68 | - return '<li class="dropdown-header">' . $item->title . '</li>'; |
|
68 | + return '<li class="dropdown-header">'.$item->title.'</li>'; |
|
69 | 69 | } |
70 | 70 | |
71 | 71 | /** |
@@ -73,13 +73,13 @@ discard block |
||
73 | 73 | */ |
74 | 74 | public function getMenuWithDropDownWrapper(MenuItemContract $item): ?string |
75 | 75 | { |
76 | - return '<li class="dropdown' . $this->getActiveStateOnChild($item, ' active') . '"> |
|
76 | + return '<li class="dropdown'.$this->getActiveStateOnChild($item, ' active').'"> |
|
77 | 77 | <a href="#" class="dropdown-toggle" data-toggle="dropdown"> |
78 | - ' . $item->getIcon() . ' ' . $item->title . ' |
|
78 | + ' . $item->getIcon().' '.$item->title.' |
|
79 | 79 | <b class="caret"></b> |
80 | 80 | </a> |
81 | 81 | <ul class="dropdown-menu"> |
82 | - ' . $this->getChildMenuItems($item) . ' |
|
82 | + ' . $this->getChildMenuItems($item).' |
|
83 | 83 | </ul> |
84 | 84 | </li>' |
85 | 85 | . PHP_EOL; |
@@ -94,13 +94,13 @@ discard block |
||
94 | 94 | */ |
95 | 95 | public function getMultiLevelDropdownWrapper(MenuItemContract $item): string |
96 | 96 | { |
97 | - return '<li class="dropdown' . $this->getActiveStateOnChild($item, ' active') . '"> |
|
97 | + return '<li class="dropdown'.$this->getActiveStateOnChild($item, ' active').'"> |
|
98 | 98 | <a href="#" class="dropdown-toggle" data-toggle="dropdown"> |
99 | - ' . $item->getIcon() . ' ' . $item->title . ' |
|
99 | + ' . $item->getIcon().' '.$item->title.' |
|
100 | 100 | <b class="caret pull-right caret-right"></b> |
101 | 101 | </a> |
102 | 102 | <ul class="dropdown-menu"> |
103 | - ' . $this->getChildMenuItems($item) . ' |
|
103 | + ' . $this->getChildMenuItems($item).' |
|
104 | 104 | </ul> |
105 | 105 | </li>' |
106 | 106 | . PHP_EOL; |
@@ -12,7 +12,7 @@ discard block |
||
12 | 12 | */ |
13 | 13 | public function getOpenTagWrapper(): ?string |
14 | 14 | { |
15 | - return PHP_EOL . '<ul class="sidebar-menu tree" data-widget="tree">' . PHP_EOL; |
|
15 | + return PHP_EOL.'<ul class="sidebar-menu tree" data-widget="tree">'.PHP_EOL; |
|
16 | 16 | } |
17 | 17 | |
18 | 18 | /** |
@@ -20,7 +20,7 @@ discard block |
||
20 | 20 | */ |
21 | 21 | public function getCloseTagWrapper(): ?string |
22 | 22 | { |
23 | - return PHP_EOL . '</ul>' . PHP_EOL; |
|
23 | + return PHP_EOL.'</ul>'.PHP_EOL; |
|
24 | 24 | } |
25 | 25 | |
26 | 26 | /** |
@@ -28,7 +28,7 @@ discard block |
||
28 | 28 | */ |
29 | 29 | public function getMenuWithoutDropdownWrapper(MenuItemContract $item): ?string |
30 | 30 | { |
31 | - return '<li' . $this->getActiveState($item) . '><a href="' . $item->getUrl() . '" ' . $item->getAttributes() . '>' . $item->getIcon() . ' <span>' . $item->title . '</span></a></li>' . PHP_EOL; |
|
31 | + return '<li'.$this->getActiveState($item).'><a href="'.$item->getUrl().'" '.$item->getAttributes().'>'.$item->getIcon().' <span>'.$item->title.'</span></a></li>'.PHP_EOL; |
|
32 | 32 | } |
33 | 33 | |
34 | 34 | /** |
@@ -65,7 +65,7 @@ discard block |
||
65 | 65 | */ |
66 | 66 | public function getHeaderWrapper(MenuItemContract $item): ?string |
67 | 67 | { |
68 | - return '<li class="header">' . $item->title . '</li>'; |
|
68 | + return '<li class="header">'.$item->title.'</li>'; |
|
69 | 69 | } |
70 | 70 | |
71 | 71 | /** |
@@ -73,15 +73,15 @@ discard block |
||
73 | 73 | */ |
74 | 74 | public function getMenuWithDropDownWrapper(MenuItemContract $item): ?string |
75 | 75 | { |
76 | - return '<li class="treeview' . $this->getActiveStateOnChild($item, ' active') . '"> |
|
76 | + return '<li class="treeview'.$this->getActiveStateOnChild($item, ' active').'"> |
|
77 | 77 | <a href="#"> |
78 | - ' . $item->getIcon() . ' <span>' . $item->title . '</span> |
|
78 | + ' . $item->getIcon().' <span>'.$item->title.'</span> |
|
79 | 79 | <span class="pull-right-container"> |
80 | 80 | <i class="fa fa-angle-left pull-right"></i> |
81 | 81 | </span> |
82 | 82 | </a> |
83 | 83 | <ul class="treeview-menu"> |
84 | - ' . $this->getChildMenuItems($item) . ' |
|
84 | + ' . $this->getChildMenuItems($item).' |
|
85 | 85 | </ul> |
86 | 86 | </li>' |
87 | 87 | . PHP_EOL; |
@@ -96,15 +96,15 @@ discard block |
||
96 | 96 | */ |
97 | 97 | public function getMultiLevelDropdownWrapper(MenuItemContract $item): string |
98 | 98 | { |
99 | - return '<li class="treeview' . $this->getActiveStateOnChild($item, ' active') . '"> |
|
99 | + return '<li class="treeview'.$this->getActiveStateOnChild($item, ' active').'"> |
|
100 | 100 | <a href="#"> |
101 | - ' . $item->getIcon() . ' <span>' . $item->title . '</span> |
|
101 | + ' . $item->getIcon().' <span>'.$item->title.'</span> |
|
102 | 102 | <span class="pull-right-container"> |
103 | 103 | <i class="fa fa-angle-left pull-right"></i> |
104 | 104 | </span> |
105 | 105 | </a> |
106 | 106 | <ul class="treeview-menu"> |
107 | - ' . $this->getChildMenuItems($item) . ' |
|
107 | + ' . $this->getChildMenuItems($item).' |
|
108 | 108 | </ul> |
109 | 109 | </li>' |
110 | 110 | . PHP_EOL; |
@@ -274,10 +274,10 @@ discard block |
||
274 | 274 | */ |
275 | 275 | public function getBadge(): string |
276 | 276 | { |
277 | - if($this->hasBadge()) { |
|
277 | + if ($this->hasBadge()) { |
|
278 | 278 | extract($this->badge); |
279 | 279 | |
280 | - return '<span class="' . $type . '">' . $text . '</span>'; |
|
280 | + return '<span class="'.$type.'">'.$text.'</span>'; |
|
281 | 281 | } |
282 | 282 | } |
283 | 283 | |
@@ -291,13 +291,13 @@ discard block |
||
291 | 291 | public function getIcon(string $default = null): ?string |
292 | 292 | { |
293 | 293 | if ($this->icon !== null && $this->icon !== '') { |
294 | - return '<i class="' . $this->icon . '"></i>'; |
|
294 | + return '<i class="'.$this->icon.'"></i>'; |
|
295 | 295 | } |
296 | 296 | if ($default === null) { |
297 | 297 | return $default; |
298 | 298 | } |
299 | 299 | |
300 | - return '<i class="' . $default . '"></i>'; |
|
300 | + return '<i class="'.$default.'"></i>'; |
|
301 | 301 | } |
302 | 302 | |
303 | 303 | /** |
@@ -508,7 +508,7 @@ discard block |
||
508 | 508 | */ |
509 | 509 | protected function getActiveStateFromRoute(): bool |
510 | 510 | { |
511 | - return Request::is(str_replace(url('/') . '/', '', $this->getUrl())); |
|
511 | + return Request::is(str_replace(url('/').'/', '', $this->getUrl())); |
|
512 | 512 | } |
513 | 513 | |
514 | 514 | /** |
@@ -106,7 +106,7 @@ discard block |
||
106 | 106 | public function it_can_create_a_dropdown_menu_item() |
107 | 107 | { |
108 | 108 | $menuItem = MenuItem::make(['title' => 'Parent Item']); |
109 | - $menuItem->dropdown('Dropdown item', function (MenuItem $sub) { |
|
109 | + $menuItem->dropdown('Dropdown item', function(MenuItem $sub) { |
|
110 | 110 | $sub->url('settings/account', 'Account'); |
111 | 111 | $sub->url('settings/password', 'Password'); |
112 | 112 | }); |
@@ -118,7 +118,7 @@ discard block |
||
118 | 118 | public function it_can_make_a_simple_route_menu_item() |
119 | 119 | { |
120 | 120 | $menuItem = MenuItem::make(['title' => 'Parent Item']); |
121 | - $menuItem->dropdown('Dropdown item', function (MenuItem $sub) { |
|
121 | + $menuItem->dropdown('Dropdown item', function(MenuItem $sub) { |
|
122 | 122 | $sub->route('settings.account', 'Account', ['user_id' => 1]); |
123 | 123 | }); |
124 | 124 | $children = $menuItem->getChildren()[0]->getChilds(); |
@@ -133,7 +133,7 @@ discard block |
||
133 | 133 | public function it_can_make_a_route_menu_item() |
134 | 134 | { |
135 | 135 | $menuItem = MenuItem::make(['title' => 'Parent Item']); |
136 | - $menuItem->dropdown('Dropdown item', function (MenuItem $sub) { |
|
136 | + $menuItem->dropdown('Dropdown item', function(MenuItem $sub) { |
|
137 | 137 | $sub->route('settings.account', 'Account', ['user_id' => 1], 1, ['my-attr' => 'value']); |
138 | 138 | }); |
139 | 139 | $children = $menuItem->getChildren()[0]->getChilds(); |
@@ -150,7 +150,7 @@ discard block |
||
150 | 150 | public function it_can_make_a_simple_url_menu_item() |
151 | 151 | { |
152 | 152 | $menuItem = MenuItem::make(['title' => 'Parent Item']); |
153 | - $menuItem->dropdown('Dropdown item', function (MenuItem $sub) { |
|
153 | + $menuItem->dropdown('Dropdown item', function(MenuItem $sub) { |
|
154 | 154 | $sub->url('settings/account', 'Account'); |
155 | 155 | }); |
156 | 156 | $children = $menuItem->getChildren()[0]->getChilds(); |
@@ -165,7 +165,7 @@ discard block |
||
165 | 165 | public function it_can_make_a_url_menu_item() |
166 | 166 | { |
167 | 167 | $menuItem = MenuItem::make(['title' => 'Parent Item']); |
168 | - $menuItem->dropdown('Dropdown item', function (MenuItem $sub) { |
|
168 | + $menuItem->dropdown('Dropdown item', function(MenuItem $sub) { |
|
169 | 169 | $sub->url('settings/account', 'Account', 1, ['my-attr' => 'value']); |
170 | 170 | }); |
171 | 171 | $children = $menuItem->getChildren()[0]->getChilds(); |
@@ -182,7 +182,7 @@ discard block |
||
182 | 182 | public function it_can_add_a_menu_item_divider() |
183 | 183 | { |
184 | 184 | $menuItem = MenuItem::make(['title' => 'Parent Item']); |
185 | - $menuItem->dropdown('Dropdown item', function (MenuItem $sub) { |
|
185 | + $menuItem->dropdown('Dropdown item', function(MenuItem $sub) { |
|
186 | 186 | $sub->url('settings/account', 'Account'); |
187 | 187 | $sub->divider(); |
188 | 188 | }); |
@@ -199,7 +199,7 @@ discard block |
||
199 | 199 | public function it_can_add_a_header_menu_item() |
200 | 200 | { |
201 | 201 | $menuItem = MenuItem::make(['title' => 'Parent Item']); |
202 | - $menuItem->dropdown('Dropdown item', function (MenuItem $sub) { |
|
202 | + $menuItem->dropdown('Dropdown item', function(MenuItem $sub) { |
|
203 | 203 | $sub->header('User Stuff'); |
204 | 204 | $sub->url('settings/account', 'Account'); |
205 | 205 | }); |
@@ -226,7 +226,7 @@ discard block |
||
226 | 226 | { |
227 | 227 | $this->app['router']->get('settings/account', ['as' => 'settings.account']); |
228 | 228 | $menuItem = MenuItem::make(['title' => 'Parent Item']); |
229 | - $menuItem->dropdown('Dropdown item', function (MenuItem $sub) { |
|
229 | + $menuItem->dropdown('Dropdown item', function(MenuItem $sub) { |
|
230 | 230 | $sub->route('settings.account', 'Account'); |
231 | 231 | }); |
232 | 232 | $children = $menuItem->getChildren()[0]->getChilds(); |
@@ -287,7 +287,7 @@ discard block |
||
287 | 287 | public function it_can_check_for_a_submenu() |
288 | 288 | { |
289 | 289 | $menuItem = MenuItem::make(['title' => 'Parent Item']); |
290 | - $menuItem->dropdown('Dropdown item', function (MenuItem $sub) { |
|
290 | + $menuItem->dropdown('Dropdown item', function(MenuItem $sub) { |
|
291 | 291 | $sub->header('User Stuff'); |
292 | 292 | $sub->url('settings/account', 'Account'); |
293 | 293 | }); |