Completed
Push — master ( c21a7a...1d1dfc )
by
unknown
56:48 queued 54:39
created
src/Menu.php 2 patches
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.
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -56,7 +56,7 @@  discard block
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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;
Please login to merge, or discard this patch.
src/SideNavHelpers.php 2 patches
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -22,7 +22,7 @@  discard block
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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;
Please login to merge, or discard this 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 2 patches
Spacing   +11 added lines, -11 removed lines patch added patch discarded remove patch
@@ -43,7 +43,7 @@  discard block
 block discarded – undo
43 43
      * @since 19 Sep 2016
44 44
      * @param $class
45 45
      */
46
-    public static function checkStatusObject($class,$method)
46
+    public static function checkStatusObject($class, $method)
47 47
     {
48 48
         self::$checkStatusObject = [
49 49
             'object' => $class,
@@ -86,7 +86,7 @@  discard block
 block discarded – undo
86 86
         self::$routes[self::$currentRoute] = [];
87 87
 
88 88
         // make menu array
89
-        $array = self::add($route,$callback);
89
+        $array = self::add($route, $callback);
90 90
 
91 91
         if (self::checkGroupId(self::$group))
92 92
             // add to the group render array
@@ -104,10 +104,10 @@  discard block
 block discarded – undo
104 104
      * @param $callback
105 105
      * @param $checkCallback
106 106
      */
107
-    public static function registerWithCheck($route , $callback , $checkCallback = null)
107
+    public static function registerWithCheck($route, $callback, $checkCallback = null)
108 108
     {
109 109
         // check status of route
110
-        if (self::checkStatus($route,$checkCallback)){
110
+        if (self::checkStatus($route, $checkCallback)) {
111 111
             self::register($route, $callback);
112 112
         }
113 113
     }
@@ -123,10 +123,10 @@  discard block
 block discarded – undo
123 123
     public static function addSub($route, $callback)
124 124
     {
125 125
         // register route name
126
-        array_push(self::$routes[self::$currentRoute],$route);
126
+        array_push(self::$routes[self::$currentRoute], $route);
127 127
 
128 128
         // return submenu array
129
-        return self::add($route,$callback);
129
+        return self::add($route, $callback);
130 130
     }
131 131
 
132 132
     /**
@@ -137,7 +137,7 @@  discard block
 block discarded – undo
137 137
      * @param $callback
138 138
      * @return array
139 139
      */
140
-    private static function add($route,$callback)
140
+    private static function add($route, $callback)
141 141
     {
142 142
         // instance of menu class
143 143
         $menu = new Menu;
@@ -157,7 +157,7 @@  discard block
 block discarded – undo
157 157
      */
158 158
     public static function routes($index = null)
159 159
     {
160
-        if($index !== null)
160
+        if ($index !== null)
161 161
             return self::$routes[$index];
162 162
 
163 163
         // return array of all routes-name
@@ -185,7 +185,7 @@  discard block
 block discarded – undo
185 185
      */
186 186
     public static function checkGroupId($type)
187 187
     {
188
-        if($type !== null && isset(self::$group))
188
+        if ($type !== null && isset(self::$group))
189 189
             return true;
190 190
 
191 191
         return false;
@@ -199,7 +199,7 @@  discard block
 block discarded – undo
199 199
      * @param $callback
200 200
      * @return bool
201 201
      */
202
-    public static function checkStatus($route,$callback = false)
202
+    public static function checkStatus($route, $callback = false)
203 203
     {
204 204
         if ($callback instanceof \Closure) {
205 205
             if ($callback())
@@ -212,7 +212,7 @@  discard block
 block discarded – undo
212 212
         // check status method name
213 213
         $method = self::$checkStatusObject['method'];
214 214
 
215
-        if(class_exists($obj)) {
215
+        if (class_exists($obj)) {
216 216
             // instance of class
217 217
             $class = new $obj;
218 218
 
Please login to merge, or discard this patch.
Braces   +15 added lines, -10 removed lines patch added patch discarded remove patch
@@ -88,9 +88,10 @@  discard block
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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 !");
Please login to merge, or discard this patch.