@@ -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; |
@@ -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; |
@@ -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 | |