Completed
Push — master ( 605113...c21a7a )
by
unknown
87:53
created
src/Menu.php 1 patch
Braces   +6 added lines, -4 removed lines patch added patch discarded remove patch
@@ -174,8 +174,9 @@  discard block
 block discarded – undo
174 174
 
175 175
         $submenu = null;
176 176
 
177
-        if(!empty($this->submenu))
178
-            $submenu = $this->submenu;
177
+        if(!empty($this->submenu)) {
178
+                    $submenu = $this->submenu;
179
+        }
179 180
 
180 181
         $result = [
181 182
             'name' => $this->route,
@@ -189,8 +190,9 @@  discard block
 block discarded – undo
189 190
             'sub' => $submenu
190 191
         ];
191 192
 
192
-        if(empty($this->submenu))
193
-            unset($result['sub']);
193
+        if(empty($this->submenu)) {
194
+                    unset($result['sub']);
195
+        }
194 196
 
195 197
         return $result;
196 198
 
Please login to merge, or discard this patch.
src/SideNavHelpers.php 1 patch
Braces   +9 added lines, -6 removed lines patch added patch discarded remove patch
@@ -15,8 +15,9 @@  discard block
 block discarded – undo
15 15
      * @return bool
16 16
      */
17 17
     function hasSub($menu){
18
-        if(! empty($menu['sub']))
19
-            return true;
18
+        if(! empty($menu['sub'])) {
19
+                    return true;
20
+        }
20 21
         return false;
21 22
     }
22 23
 }
@@ -31,8 +32,9 @@  discard block
 block discarded – undo
31 32
 
32 33
         $tag = $value['tag'];
33 34
 
34
-        if($value['tag'] === null)
35
-            $tag = 'i';
35
+        if($value['tag'] === null) {
36
+                    $tag = 'i';
37
+        }
36 38
 
37 39
         return '<' . $tag . ' class="' . $value['value'] . '"></' . $tag . '>';
38 40
     }
@@ -45,8 +47,9 @@  discard block
 block discarded – undo
45 47
      * @return null|string
46 48
      */
47 49
     function new_tab($newTab){
48
-        if($newTab)
49
-            return 'target="_blank"';
50
+        if($newTab) {
51
+                    return 'target="_blank"';
52
+        }
50 53
 
51 54
         return null;
52 55
     }
Please login to merge, or discard this patch.
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.