@@ -88,9 +88,10 @@ discard block |
||
88 | 88 | // make menu array |
89 | 89 | $array = self::add($route,$callback); |
90 | 90 | |
91 | - if (self::checkGroupId(self::$group)) |
|
92 | - // add to the group render array |
|
91 | + if (self::checkGroupId(self::$group)) { |
|
92 | + // add to the group render array |
|
93 | 93 | array_push(self::$menu[self::$group], $array); |
94 | + } |
|
94 | 95 | |
95 | 96 | // add to the single render array |
96 | 97 | array_push(self::$menu, $array); |
@@ -157,8 +158,9 @@ discard block |
||
157 | 158 | */ |
158 | 159 | public static function routes($index = null) |
159 | 160 | { |
160 | - if($index !== null) |
|
161 | - return self::$routes[$index]; |
|
161 | + if($index !== null) { |
|
162 | + return self::$routes[$index]; |
|
163 | + } |
|
162 | 164 | |
163 | 165 | // return array of all routes-name |
164 | 166 | return self::$routes; |
@@ -185,8 +187,9 @@ discard block |
||
185 | 187 | */ |
186 | 188 | public static function checkGroupId($type) |
187 | 189 | { |
188 | - if($type !== null && isset(self::$group)) |
|
189 | - return true; |
|
190 | + if($type !== null && isset(self::$group)) { |
|
191 | + return true; |
|
192 | + } |
|
190 | 193 | |
191 | 194 | return false; |
192 | 195 | } |
@@ -202,8 +205,9 @@ discard block |
||
202 | 205 | public static function checkStatus($route,$callback = false) |
203 | 206 | { |
204 | 207 | if ($callback instanceof \Closure) { |
205 | - if ($callback()) |
|
206 | - return true; |
|
208 | + if ($callback()) { |
|
209 | + return true; |
|
210 | + } |
|
207 | 211 | } |
208 | 212 | |
209 | 213 | // check status class name |
@@ -217,8 +221,9 @@ discard block |
||
217 | 221 | $class = new $obj; |
218 | 222 | |
219 | 223 | // call method of class |
220 | - if ($class->$method($route)) |
|
221 | - return true; |
|
224 | + if ($class->$method($route)) { |
|
225 | + return true; |
|
226 | + } |
|
222 | 227 | return false; |
223 | 228 | } else { |
224 | 229 | throw new \Exception("The CheckStatus class not found !"); |