@@ -56,7 +56,7 @@ discard block |
||
56 | 56 | public function sub($route, $callback) |
57 | 57 | { |
58 | 58 | $sub = SideNav::addSub($route, $callback); |
59 | - array_push($this->submenu,$sub); |
|
59 | + array_push($this->submenu, $sub); |
|
60 | 60 | } |
61 | 61 | |
62 | 62 | /** |
@@ -68,10 +68,10 @@ discard block |
||
68 | 68 | */ |
69 | 69 | public function subWithCheckStatus($route, $callback) |
70 | 70 | { |
71 | - if(SideNav::checkStatus($route) === true) |
|
71 | + if (SideNav::checkStatus($route) === true) |
|
72 | 72 | { |
73 | 73 | $sub = SideNav::addSub($route, $callback); |
74 | - array_push($this->submenu,$sub); |
|
74 | + array_push($this->submenu, $sub); |
|
75 | 75 | } |
76 | 76 | } |
77 | 77 | |
@@ -202,7 +202,7 @@ discard block |
||
202 | 202 | |
203 | 203 | $submenu = null; |
204 | 204 | |
205 | - if(!empty($this->submenu)) |
|
205 | + if (!empty($this->submenu)) |
|
206 | 206 | $submenu = $this->submenu; |
207 | 207 | |
208 | 208 | $result = [ |
@@ -217,7 +217,7 @@ discard block |
||
217 | 217 | 'sub' => $submenu |
218 | 218 | ]; |
219 | 219 | |
220 | - if(empty($this->submenu)) |
|
220 | + if (empty($this->submenu)) |
|
221 | 221 | unset($result['sub']); |
222 | 222 | |
223 | 223 | return $result; |
@@ -83,7 +83,7 @@ discard block |
||
83 | 83 | self::$routes[self::$currentRoute] = []; |
84 | 84 | |
85 | 85 | // make menu array |
86 | - $array = self::add($route,$callback); |
|
86 | + $array = self::add($route, $callback); |
|
87 | 87 | |
88 | 88 | if (self::checkGroupId(self::$type)) |
89 | 89 | // add to the group render array |
@@ -121,10 +121,10 @@ discard block |
||
121 | 121 | public static function addSub($route, $callback) |
122 | 122 | { |
123 | 123 | // register route name |
124 | - array_push(self::$routes[self::$currentRoute],$route); |
|
124 | + array_push(self::$routes[self::$currentRoute], $route); |
|
125 | 125 | |
126 | 126 | // return submenu array |
127 | - return self::add($route,$callback); |
|
127 | + return self::add($route, $callback); |
|
128 | 128 | } |
129 | 129 | |
130 | 130 | /** |
@@ -135,7 +135,7 @@ discard block |
||
135 | 135 | * @param $callback |
136 | 136 | * @return array |
137 | 137 | */ |
138 | - private static function add($route,$callback) |
|
138 | + private static function add($route, $callback) |
|
139 | 139 | { |
140 | 140 | // instance of menu class |
141 | 141 | $menu = new Menu; |
@@ -156,7 +156,7 @@ discard block |
||
156 | 156 | public static function routes() |
157 | 157 | { |
158 | 158 | // return json array of all routes-name |
159 | - if(self::$resultType === 'json') |
|
159 | + if (self::$resultType === 'json') |
|
160 | 160 | return json_encode(self::$routes); |
161 | 161 | |
162 | 162 | // return array of all routes-name |
@@ -184,11 +184,11 @@ discard block |
||
184 | 184 | */ |
185 | 185 | public static function render($type = null) |
186 | 186 | { |
187 | - if(self::checkGroupId($type)) |
|
187 | + if (self::checkGroupId($type)) |
|
188 | 188 | { |
189 | 189 | |
190 | 190 | // render the menu json array |
191 | - if(self::$resultType === 'json') |
|
191 | + if (self::$resultType === 'json') |
|
192 | 192 | return json_encode(self::$menu[$type]); |
193 | 193 | |
194 | 194 | // render the menu array |
@@ -196,7 +196,7 @@ discard block |
||
196 | 196 | } |
197 | 197 | |
198 | 198 | // return single menu json array |
199 | - if(self::$resultType === 'json') |
|
199 | + if (self::$resultType === 'json') |
|
200 | 200 | return json_encode(self::$menu); |
201 | 201 | |
202 | 202 | // return single menu array |
@@ -211,7 +211,7 @@ discard block |
||
211 | 211 | */ |
212 | 212 | public static function checkGroupId($type) |
213 | 213 | { |
214 | - if($type !== null && isset(self::$type)) |
|
214 | + if ($type !== null && isset(self::$type)) |
|
215 | 215 | return true; |
216 | 216 | |
217 | 217 | return false; |
@@ -228,7 +228,7 @@ discard block |
||
228 | 228 | { |
229 | 229 | $obj = self::$checkStatusObject; |
230 | 230 | |
231 | - if(class_exists($obj)) |
|
231 | + if (class_exists($obj)) |
|
232 | 232 | { |
233 | 233 | $class = new $obj; |
234 | 234 | if ($class->handle($route)) |
@@ -22,7 +22,7 @@ discard block |
||
22 | 22 | public static function hasSub($menu) |
23 | 23 | { |
24 | 24 | // check menu has sub |
25 | - if(! empty($menu['sub'])) |
|
25 | + if (!empty($menu['sub'])) |
|
26 | 26 | return true; |
27 | 27 | |
28 | 28 | return false; |
@@ -40,7 +40,7 @@ discard block |
||
40 | 40 | |
41 | 41 | $tag = $value['tag']; |
42 | 42 | |
43 | - if($value['tag'] === null) |
|
43 | + if ($value['tag'] === null) |
|
44 | 44 | $tag = 'i'; |
45 | 45 | |
46 | 46 | return '<' . $tag . ' class="' . $value['value'] . '"></' . $tag . '>'; |
@@ -55,7 +55,7 @@ discard block |
||
55 | 55 | */ |
56 | 56 | public static function new_tab($newTab) |
57 | 57 | { |
58 | - if($newTab) |
|
58 | + if ($newTab) |
|
59 | 59 | return 'target="_blank"'; |
60 | 60 | |
61 | 61 | return null; |