Completed
Push — master ( 605113...c21a7a )
by
unknown
87:53
created
src/SideNav.php 1 patch
Braces   +21 added lines, -14 removed lines patch added patch discarded remove patch
@@ -91,9 +91,10 @@  discard block
 block discarded – undo
91 91
         // make menu array
92 92
         $array = self::add($route,$callback);
93 93
 
94
-        if (self::checkGroupId(self::$type))
95
-            // add to the group render array
94
+        if (self::checkGroupId(self::$type)) {
95
+                    // add to the group render array
96 96
             array_push(self::$menu[self::$type], $array);
97
+        }
97 98
 
98 99
         // add to the single render array
99 100
         array_push(self::$menu, $array);
@@ -161,8 +162,9 @@  discard block
 block discarded – undo
161 162
     public static function routes()
162 163
     {
163 164
         // return json array of all routes-name
164
-        if(self::$resultType === 'json')
165
-            return json_encode(self::$routes);
165
+        if(self::$resultType === 'json') {
166
+                    return json_encode(self::$routes);
167
+        }
166 168
 
167 169
         // return array of all routes-name
168 170
         return self::$routes;
@@ -193,16 +195,18 @@  discard block
 block discarded – undo
193 195
         {
194 196
 
195 197
             // render the menu json array
196
-            if(self::$resultType === 'json')
197
-                return json_encode(self::$menu[$type]);
198
+            if(self::$resultType === 'json') {
199
+                            return json_encode(self::$menu[$type]);
200
+            }
198 201
 
199 202
             // render the menu array
200 203
             return self::$menu[$type];
201 204
         }
202 205
 
203 206
         // return single menu json array
204
-        if(self::$resultType === 'json')
205
-            return json_encode(self::$menu);
207
+        if(self::$resultType === 'json') {
208
+                    return json_encode(self::$menu);
209
+        }
206 210
 
207 211
         // return single menu array
208 212
         return self::$menu[0];
@@ -216,8 +220,9 @@  discard block
 block discarded – undo
216 220
      */
217 221
     public static function checkGroupId($type)
218 222
     {
219
-        if($type !== null && isset(self::$type))
220
-            return true;
223
+        if($type !== null && isset(self::$type)) {
224
+                    return true;
225
+        }
221 226
 
222 227
         return false;
223 228
     }
@@ -233,8 +238,9 @@  discard block
 block discarded – undo
233 238
     public static function checkStatus($route,$callback = false)
234 239
     {
235 240
         if ($callback instanceof \Closure) {
236
-            if ($callback())
237
-                return true;
241
+            if ($callback()) {
242
+                            return true;
243
+            }
238 244
         }
239 245
 
240 246
         // check status class name
@@ -248,8 +254,9 @@  discard block
 block discarded – undo
248 254
             $class = new $obj;
249 255
 
250 256
             // call method of class
251
-            if ($class->$method($route))
252
-                return true;
257
+            if ($class->$method($route)) {
258
+                            return true;
259
+            }
253 260
             return false;
254 261
         } else {
255 262
             throw new \Exception("The CheckStatus class not found !");
Please login to merge, or discard this patch.