Passed
Push — master ( 774a5f...224122 )
by Ferry
05:43 queued 02:10
created
src/controllers/DeveloperRolesController.php 1 patch
Braces   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -80,7 +80,7 @@  discard block
 block discarded – undo
80 80
     private function existsPrivilege($cb_roles_id, $cb_menus_id) {
81 81
         if($row = cb()->find("cb_role_privileges",['cb_roles_id'=>$cb_roles_id,'cb_menus_id'=>$cb_menus_id])) {
82 82
             return $row->id;
83
-        }else{
83
+        } else{
84 84
             return null;
85 85
         }
86 86
     }
@@ -102,7 +102,7 @@  discard block
 block discarded – undo
102 102
                 $privilege["can_delete"] = $menu['can_delete']?:0;
103 103
                 if($privilege_id = $this->existsPrivilege($id, $menus_id)) {
104 104
                     DB::table("cb_role_privileges")->where("id", $privilege_id)->update($privilege);
105
-                }else{
105
+                } else{
106 106
                     DB::table("cb_role_privileges")->insert($privilege);
107 107
                 }
108 108
             }
Please login to merge, or discard this patch.
src/controllers/AdminProfileController.php 1 patch
Braces   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -31,7 +31,7 @@
 block discarded – undo
31 31
                 $data['photo'] = cb()->uploadFile('photo', true, 200, 200);
32 32
             }
33 33
             DB::table("users")->where("id", auth()->id())->update($data);
34
-        }catch (\Exception $e) {
34
+        } catch (\Exception $e) {
35 35
             Log::error($e);
36 36
             return cb()->redirectBack("Something went wrong!","warning");
37 37
         }
Please login to merge, or discard this patch.
src/helpers/Helper.php 1 patch
Braces   +18 added lines, -15 removed lines patch added patch discarded remove patch
@@ -131,7 +131,7 @@  discard block
 block discarded – undo
131 131
 	    $newLocation = $pathWithoutName.'/w_'.$width.'_h_'.$height.'_'.$basename;
132 132
 	    if(Storage::exists($newLocation)) {
133 133
 	        return asset($newLocation);
134
-	    }else{
134
+	    } else{
135 135
 	        $img = Image::make(storage_path($path))->fit($width,$height);
136 136
 	        $img->save(storage_path($newLocation),$quality);
137 137
 	        return asset($newLocation);
@@ -177,7 +177,7 @@  discard block
 block discarded – undo
177 177
         if(file_exists(storage_path('.cbconfig'))) {
178 178
             $settings = file_get_contents(storage_path('.cbconfig'));
179 179
             $settings = unserialize($settings);
180
-        }else{
180
+        } else{
181 181
             $settings = [];
182 182
         }
183 183
 
@@ -194,13 +194,13 @@  discard block
 block discarded – undo
194 194
         if(file_exists(storage_path('.cbconfig'))) {
195 195
             $settings = file_get_contents(storage_path('.cbconfig'));
196 196
             $settings = unserialize($settings);
197
-        }else{
197
+        } else{
198 198
             $settings = [];
199 199
         }
200 200
 
201 201
         if(isset($settings[$key])) {
202 202
             return $settings[$key]?:$default;
203
-        }else{
203
+        } else{
204 204
             return $default;
205 205
         }
206 206
     }
@@ -286,7 +286,7 @@  discard block
 block discarded – undo
286 286
         $url = request($name);
287 287
         if(filter_var($url, FILTER_VALIDATE_URL)) {
288 288
             return $url;
289
-        }else{
289
+        } else{
290 290
             return request()->url();
291 291
         }
292 292
     }
@@ -298,14 +298,14 @@  discard block
 block discarded – undo
298 298
             $response = request($name);
299 299
             if(is_string($response)) {
300 300
                 $response = sanitizeXSS($response);
301
-            }elseif (is_array($response)) {
301
+            } elseif (is_array($response)) {
302 302
                 array_walk_recursive($response, function(&$response) {
303 303
                     $response = sanitizeXSS($response);
304 304
                 });
305 305
             }
306 306
 
307 307
             return $response;
308
-        }else{
308
+        } else{
309 309
             return Request::get($name);
310 310
         }
311 311
     }
@@ -315,11 +315,13 @@  discard block
 block discarded – undo
315 315
     function min_var_export($input) {
316 316
         if(is_array($input)) {
317 317
             $buffer = [];
318
-            foreach($input as $key => $value)
319
-                $buffer[] = var_export($key, true)."=>".min_var_export($value);
318
+            foreach($input as $key => $value) {
319
+                            $buffer[] = var_export($key, true)."=>".min_var_export($value);
320
+            }
320 321
             return "[".implode(",",$buffer)."]";
321
-        } else
322
-            return var_export($input, true);
322
+        } else {
323
+                    return var_export($input, true);
324
+        }
323 325
     }
324 326
 }
325 327
 
@@ -332,10 +334,11 @@  discard block
 block discarded – undo
332 334
 	     $objects = scandir($dir); 
333 335
 	     foreach ($objects as $object) { 
334 336
 	       if ($object != "." && $object != "..") { 
335
-	         if (is_dir($dir."/".$object))
336
-	           rrmdir($dir."/".$object);
337
-	         else
338
-	           unlink($dir."/".$object); 
337
+	         if (is_dir($dir."/".$object)) {
338
+	         	           rrmdir($dir."/".$object);
339
+	         } else {
340
+	         	           unlink($dir."/".$object);
341
+	         }
339 342
 	       } 
340 343
 	     }
341 344
 	     rmdir($dir); 
Please login to merge, or discard this patch.
src/helpers/CB.php 1 patch
Braces   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -103,7 +103,7 @@
 block discarded – undo
103 103
                 } else {
104 104
                     throw new \Exception("Something went wrong, file can't upload!");
105 105
                 }
106
-            }else{
106
+            } else{
107 107
                 throw new \Exception("The file format is not allowed!");
108 108
             }
109 109
 
Please login to merge, or discard this patch.
src/routes.php 1 patch
Braces   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -51,7 +51,7 @@
 block discarded – undo
51 51
     if (Request::is(cbConfig('ADMIN_PATH'))) {
52 52
         if($dashboard = cbConfig("ADMIN_DASHBOARD_CONTROLLER")) {
53 53
             cb()->routeGet("/", $dashboard);
54
-        }else{
54
+        } else{
55 55
             cb()->routeGet("/", "\crocodicstudio\crudbooster\controllers\AdminDashboardController@getIndex");
56 56
         }
57 57
     }
Please login to merge, or discard this patch.
src/controllers/DeveloperUsersController.php 1 patch
Braces   +3 added lines, -1 removed lines patch added patch discarded remove patch
@@ -71,7 +71,9 @@
 block discarded – undo
71 71
             $user = [];
72 72
             $user['name'] = request('name');
73 73
             $user['email'] = request('email');
74
-            if(request('password')) $user['password'] = Hash::make(request('password'));
74
+            if(request('password')) {
75
+                $user['password'] = Hash::make(request('password'));
76
+            }
75 77
             $user['cb_roles_id'] = request('cb_roles_id');
76 78
             DB::table('users')->where('id',$id)->update($user);
77 79
 
Please login to merge, or discard this patch.
src/controllers/DeveloperMenusController.php 1 patch
Braces   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -54,9 +54,9 @@  discard block
 block discarded – undo
54 54
             $menu['type'] = request('type');
55 55
             if(request('type') == 'module') {
56 56
                 $menu['cb_modules_id'] = request('cb_modules_id');
57
-            }elseif (request('type') == 'url') {
57
+            } elseif (request('type') == 'url') {
58 58
                 $menu['path'] = request('url_value');
59
-            }elseif (request('type') == 'path') {
59
+            } elseif (request('type') == 'path') {
60 60
                 $menu['path'] = request('path_value');
61 61
             }
62 62
 
@@ -79,9 +79,9 @@  discard block
 block discarded – undo
79 79
             $menu['type'] = request('type');
80 80
             if(request('type') == 'module') {
81 81
                 $menu['cb_modules_id'] = request('cb_modules_id');
82
-            }elseif (request('type') == 'url') {
82
+            } elseif (request('type') == 'url') {
83 83
                 $menu['path'] = request('url_value');
84
-            }elseif (request('type') == 'path') {
84
+            } elseif (request('type') == 'path') {
85 85
                 $menu['path'] = request('path_value');
86 86
             }
87 87
             DB::table("cb_menus")->where("id",$id)->update($menu);
Please login to merge, or discard this patch.
src/controllers/scaffolding/singletons/ColumnSingleton.php 1 patch
Braces   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -44,7 +44,7 @@  discard block
 block discarded – undo
44 44
             /** @var ColumnModel $column */
45 45
             if($data_row) {
46 46
                 $value = $data_row->{ $column->getField() };
47
-            }else{
47
+            } else{
48 48
                 $value = request($column->getName());
49 49
             }
50 50
 
@@ -138,7 +138,7 @@  discard block
 block discarded – undo
138 138
                 foreach($column->getValue() as $key=>$val) {
139 139
                     $data[$key] = $val;
140 140
                 }
141
-            }else{
141
+            } else{
142 142
                 $data[$column->getField()] = $column->getValue();
143 143
             }
144 144
         }
Please login to merge, or discard this patch.
src/controllers/AdminAuthController.php 1 patch
Braces   +6 added lines, -4 removed lines patch added patch discarded remove patch
@@ -7,7 +7,9 @@  discard block
 block discarded – undo
7 7
 
8 8
     public function getLogin()
9 9
     {
10
-        if(!auth()->guest()) return redirect(cb()->getAdminUrl());
10
+        if(!auth()->guest()) {
11
+            return redirect(cb()->getAdminUrl());
12
+        }
11 13
 
12 14
         cbHook()->hookGetLogin();
13 15
 
@@ -28,7 +30,7 @@  discard block
 block discarded – undo
28 30
             } else {
29 31
                 return redirect(cb()->getLoginUrl())->with(['message'=>__('crudbooster.alert_password_wrong'),'message_type'=>'warning']);
30 32
             }
31
-        }catch (CBValidationException $e) {
33
+        } catch (CBValidationException $e) {
32 34
             return cb()->redirect(cb()->getAdminUrl("login"),$e->getMessage(),'warning');
33 35
         }
34 36
     }
@@ -57,11 +59,11 @@  discard block
 block discarded – undo
57 59
 
58 60
                 return redirect(cb()->getDeveloperUrl());
59 61
 
60
-            }else{
62
+            } else{
61 63
                 return cb()->redirectBack("Username and or password is wrong!");
62 64
             }
63 65
 
64
-        }catch (CBValidationException $e) {
66
+        } catch (CBValidationException $e) {
65 67
             return cb()->redirect(cb()->getLoginUrl(),$e->getMessage(),'warning');
66 68
         }
67 69
     }
Please login to merge, or discard this patch.