@@ -174,8 +174,9 @@ discard block |
||
| 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 |
||
| 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 | |
@@ -15,8 +15,9 @@ discard block |
||
| 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 |
||
| 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 |
||
| 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 | } |
@@ -79,9 +79,10 @@ discard block |
||
| 79 | 79 | // make menu array |
| 80 | 80 | $array = self::add($route,$callback); |
| 81 | 81 | |
| 82 | - if (self::checkGroupId(self::$type)) |
|
| 83 | - // add to the group render array |
|
| 82 | + if (self::checkGroupId(self::$type)) { |
|
| 83 | + // add to the group render array |
|
| 84 | 84 | array_push(self::$menu[self::$type], $array); |
| 85 | + } |
|
| 85 | 86 | |
| 86 | 87 | // add to the single render array |
| 87 | 88 | array_push(self::$menu, $array); |
@@ -141,8 +142,9 @@ discard block |
||
| 141 | 142 | public static function routes() |
| 142 | 143 | { |
| 143 | 144 | // return json array of all routes-name |
| 144 | - if(self::$resultType === 'json') |
|
| 145 | - return json_encode(self::$routes); |
|
| 145 | + if(self::$resultType === 'json') { |
|
| 146 | + return json_encode(self::$routes); |
|
| 147 | + } |
|
| 146 | 148 | |
| 147 | 149 | // return array of all routes-name |
| 148 | 150 | return self::$routes; |
@@ -163,16 +165,18 @@ discard block |
||
| 163 | 165 | if(self::checkGroupId($type)) { |
| 164 | 166 | |
| 165 | 167 | // render the menu json array |
| 166 | - if(self::$resultType === 'json') |
|
| 167 | - return json_encode(self::$menu[$type]); |
|
| 168 | + if(self::$resultType === 'json') { |
|
| 169 | + return json_encode(self::$menu[$type]); |
|
| 170 | + } |
|
| 168 | 171 | |
| 169 | 172 | // render the menu array |
| 170 | 173 | return self::$menu[$type]; |
| 171 | 174 | } |
| 172 | 175 | |
| 173 | 176 | // return single menu json array |
| 174 | - if(self::$resultType === 'json') |
|
| 175 | - return json_encode(self::$menu); |
|
| 177 | + if(self::$resultType === 'json') { |
|
| 178 | + return json_encode(self::$menu); |
|
| 179 | + } |
|
| 176 | 180 | |
| 177 | 181 | // return single menu array |
| 178 | 182 | return self::$menu; |
@@ -184,8 +188,9 @@ discard block |
||
| 184 | 188 | */ |
| 185 | 189 | public static function checkGroupId($type) |
| 186 | 190 | { |
| 187 | - if($type !== null && isset(self::$type)) |
|
| 188 | - return true; |
|
| 191 | + if($type !== null && isset(self::$type)) { |
|
| 192 | + return true; |
|
| 193 | + } |
|
| 189 | 194 | |
| 190 | 195 | return false; |
| 191 | 196 | } |
@@ -201,8 +206,9 @@ discard block |
||
| 201 | 206 | |
| 202 | 207 | if(class_exists($obj)) { |
| 203 | 208 | $class = new $obj; |
| 204 | - if ($class->handle($route)) |
|
| 205 | - return true; |
|
| 209 | + if ($class->handle($route)) { |
|
| 210 | + return true; |
|
| 211 | + } |
|
| 206 | 212 | return false; |
| 207 | 213 | } |
| 208 | 214 | |