@@ -46,7 +46,7 @@ discard block |
||
| 46 | 46 | * @since 19 Sep 2016 |
| 47 | 47 | * @param $class |
| 48 | 48 | */ |
| 49 | - public static function checkStatusObject($class,$method) |
|
| 49 | + public static function checkStatusObject($class, $method) |
|
| 50 | 50 | { |
| 51 | 51 | self::$checkStatusObject = [ |
| 52 | 52 | 'object' => $class, |
@@ -89,7 +89,7 @@ discard block |
||
| 89 | 89 | self::$routes[self::$currentRoute] = []; |
| 90 | 90 | |
| 91 | 91 | // make menu array |
| 92 | - $array = self::add($route,$callback); |
|
| 92 | + $array = self::add($route, $callback); |
|
| 93 | 93 | |
| 94 | 94 | if (self::checkGroupId(self::$type)) |
| 95 | 95 | // add to the group render array |
@@ -107,10 +107,10 @@ discard block |
||
| 107 | 107 | * @param $callback |
| 108 | 108 | * @param $checkCallback |
| 109 | 109 | */ |
| 110 | - public static function registerWithCheckStatus($route , $callback , $checkCallback = null) |
|
| 110 | + public static function registerWithCheckStatus($route, $callback, $checkCallback = null) |
|
| 111 | 111 | { |
| 112 | 112 | // check status of route |
| 113 | - if (self::checkStatus($route,$checkCallback)){ |
|
| 113 | + if (self::checkStatus($route, $checkCallback)) { |
|
| 114 | 114 | self::register($route, $callback); |
| 115 | 115 | } |
| 116 | 116 | } |
@@ -126,10 +126,10 @@ discard block |
||
| 126 | 126 | public static function addSub($route, $callback) |
| 127 | 127 | { |
| 128 | 128 | // register route name |
| 129 | - array_push(self::$routes[self::$currentRoute],$route); |
|
| 129 | + array_push(self::$routes[self::$currentRoute], $route); |
|
| 130 | 130 | |
| 131 | 131 | // return submenu array |
| 132 | - return self::add($route,$callback); |
|
| 132 | + return self::add($route, $callback); |
|
| 133 | 133 | } |
| 134 | 134 | |
| 135 | 135 | /** |
@@ -140,7 +140,7 @@ discard block |
||
| 140 | 140 | * @param $callback |
| 141 | 141 | * @return array |
| 142 | 142 | */ |
| 143 | - private static function add($route,$callback) |
|
| 143 | + private static function add($route, $callback) |
|
| 144 | 144 | { |
| 145 | 145 | // instance of menu class |
| 146 | 146 | $menu = new Menu; |
@@ -161,7 +161,7 @@ discard block |
||
| 161 | 161 | public static function routes() |
| 162 | 162 | { |
| 163 | 163 | // return json array of all routes-name |
| 164 | - if(self::$resultType === 'json') |
|
| 164 | + if (self::$resultType === 'json') |
|
| 165 | 165 | return json_encode(self::$routes); |
| 166 | 166 | |
| 167 | 167 | // return array of all routes-name |
@@ -189,11 +189,11 @@ discard block |
||
| 189 | 189 | */ |
| 190 | 190 | public static function render($type = null) |
| 191 | 191 | { |
| 192 | - if(self::checkGroupId($type)) |
|
| 192 | + if (self::checkGroupId($type)) |
|
| 193 | 193 | { |
| 194 | 194 | |
| 195 | 195 | // render the menu json array |
| 196 | - if(self::$resultType === 'json') |
|
| 196 | + if (self::$resultType === 'json') |
|
| 197 | 197 | return json_encode(self::$menu[$type]); |
| 198 | 198 | |
| 199 | 199 | // render the menu array |
@@ -201,7 +201,7 @@ discard block |
||
| 201 | 201 | } |
| 202 | 202 | |
| 203 | 203 | // return single menu json array |
| 204 | - if(self::$resultType === 'json') |
|
| 204 | + if (self::$resultType === 'json') |
|
| 205 | 205 | return json_encode(self::$menu); |
| 206 | 206 | |
| 207 | 207 | // return single menu array |
@@ -216,7 +216,7 @@ discard block |
||
| 216 | 216 | */ |
| 217 | 217 | public static function checkGroupId($type) |
| 218 | 218 | { |
| 219 | - if($type !== null && isset(self::$type)) |
|
| 219 | + if ($type !== null && isset(self::$type)) |
|
| 220 | 220 | return true; |
| 221 | 221 | |
| 222 | 222 | return false; |
@@ -230,7 +230,7 @@ discard block |
||
| 230 | 230 | * @param $callback |
| 231 | 231 | * @return bool |
| 232 | 232 | */ |
| 233 | - public static function checkStatus($route,$callback = false) |
|
| 233 | + public static function checkStatus($route, $callback = false) |
|
| 234 | 234 | { |
| 235 | 235 | if ($callback instanceof \Closure) { |
| 236 | 236 | if ($callback()) |
@@ -243,7 +243,7 @@ discard block |
||
| 243 | 243 | // check status method name |
| 244 | 244 | $method = self::$checkStatusObject['method']; |
| 245 | 245 | |
| 246 | - if(class_exists($obj)) { |
|
| 246 | + if (class_exists($obj)) { |
|
| 247 | 247 | // instance of class |
| 248 | 248 | $class = new $obj; |
| 249 | 249 | |