Passed
Push — master ( 3be567...10f746 )
by Ferry
03:51
created
src/types/radio/Radio.php 1 patch
Braces   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -36,7 +36,7 @@
 block discarded – undo
36 36
         $data = DB::table($table);
37 37
         if($SQLCondition && is_callable($SQLCondition)) {
38 38
             $data = call_user_func($SQLCondition, $data);
39
-        }elseif ($SQLCondition && is_string($SQLCondition)) {
39
+        } elseif ($SQLCondition && is_string($SQLCondition)) {
40 40
             $data->whereRaw($SQLCondition);
41 41
         }
42 42
         $data = $data->get();
Please login to merge, or discard this patch.
src/types/select/Hook.php 1 patch
Braces   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -36,7 +36,7 @@
 block discarded – undo
36 36
         if($column->getOptionsFromTable()) {
37 37
             $option = $column->getOptionsFromTable();
38 38
             return $row->{ $option['table'].'_'.$option['display_field'] };
39
-        }else{
39
+        } else{
40 40
             $option = $column->getOptions();
41 41
             $key = $row->{ $column->getField() };
42 42
             return @$option[ $key ];
Please login to merge, or discard this patch.
src/types/checkbox/Checkbox.php 1 patch
Braces   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -36,7 +36,7 @@
 block discarded – undo
36 36
         $data = DB::table($table);
37 37
         if($SQLCondition && is_callable($SQLCondition)) {
38 38
             $data = call_user_func($SQLCondition, $data);
39
-        }elseif ($SQLCondition && is_string($SQLCondition)) {
39
+        } elseif ($SQLCondition && is_string($SQLCondition)) {
40 40
             $data->whereRaw($SQLCondition);
41 41
         }
42 42
         $data = $data->get();
Please login to merge, or discard this patch.
src/types/select/Select.php 1 patch
Braces   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -36,7 +36,7 @@
 block discarded – undo
36 36
         $data = DB::table($table);
37 37
         if($SQLCondition && is_callable($SQLCondition)) {
38 38
             $data = call_user_func($SQLCondition, $data);
39
-        }elseif ($SQLCondition && is_string($SQLCondition)) {
39
+        } elseif ($SQLCondition && is_string($SQLCondition)) {
40 40
             $data->whereRaw($SQLCondition);
41 41
         }
42 42
         $data = $data->get();
Please login to merge, or discard this patch.
src/types/date/Hook.php 1 patch
Braces   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -22,7 +22,7 @@
 block discarded – undo
22 22
     {
23 23
         if($column->getFormat()) {
24 24
             return date($column->getFormat(), strtotime($row->{$column->getField()}));
25
-        }else{
25
+        } else{
26 26
             return $row->{$column->getField()};
27 27
         }
28 28
     }
Please login to merge, or discard this patch.
src/helpers/UserSession.php 1 patch
Braces   +5 added lines, -2 removed lines patch added patch discarded remove patch
@@ -28,8 +28,11 @@
 block discarded – undo
28 28
     {
29 29
         $user = $this->user();
30 30
         $role = cb()->find("cb_roles", $user->cb_roles_id);
31
-        if($role) return $role->name;
32
-        else return null;
31
+        if($role) {
32
+            return $role->name;
33
+        } else {
34
+            return null;
35
+        }
33 36
     }
34 37
 
35 38
     public function roleId()
Please login to merge, or discard this patch.
src/helpers/SidebarMenus.php 1 patch
Braces   +19 added lines, -9 removed lines patch added patch discarded remove patch
@@ -27,7 +27,7 @@  discard block
 block discarded – undo
27 27
             $model->setIcon($menu->icon);
28 28
             $model->setName($menu->name);
29 29
             $model->setBasepath(basename($model->getUrl()));
30
-        }elseif ($menu->type == "module") {
30
+        } elseif ($menu->type == "module") {
31 31
             $module = cb()->find("cb_modules", $menu->cb_modules_id);
32 32
             $className = '\App\Http\Controllers\\'.$module->controller;
33 33
             $controllerClass = new $className();
@@ -36,7 +36,7 @@  discard block
 block discarded – undo
36 36
             $model->setIcon($module->icon);
37 37
             $model->setName($module->name);
38 38
             $model->setBasepath(config('crudbooster.ADMIN_PATH').'/'.basename($model->getUrl()));
39
-        }elseif ($menu->type == "path") {
39
+        } elseif ($menu->type == "path") {
40 40
             $model->setUrl(cb()->getAdminUrl($menu->path));
41 41
             $model->setIcon($menu->icon);
42 42
             $model->setName($menu->name);
@@ -45,7 +45,7 @@  discard block
 block discarded – undo
45 45
 
46 46
         if(request()->is($model->getBasepath()."*")) {
47 47
             $model->setIsActive(true);
48
-        }else{
48
+        } else{
49 49
             $model->setIsActive(false);
50 50
         }
51 51
 
@@ -56,7 +56,7 @@  discard block
 block discarded – undo
56 56
         $menus = DB::table("cb_menus");
57 57
         if($parent_id) {
58 58
             $menus->where("parent_cb_menus_id",$parent_id);
59
-        }else{
59
+        } else{
60 60
             $menus->whereNull("parent_cb_menus_id");
61 61
         }
62 62
         return $menus->orderBy("sort_number","asc")->get();
@@ -84,26 +84,36 @@  discard block
 block discarded – undo
84 84
         $menus_active = false;
85 85
         foreach($menus as $menu) {
86 86
 
87
-            if($withPrivilege && !$this->checkPrivilege($roles_id, $menu)) continue;
87
+            if($withPrivilege && !$this->checkPrivilege($roles_id, $menu)) {
88
+                continue;
89
+            }
88 90
 
89 91
             $sidebarModel = $this->assignToModel($menu);
90
-            if($sidebarModel->getisActive()) $menus_active = true;
92
+            if($sidebarModel->getisActive()) {
93
+                $menus_active = true;
94
+            }
91 95
             if($menus2 = $this->loadData($menu->id)) {
92 96
                 $sub1 = [];
93 97
                 $menus2_active = false;
94 98
                 foreach ($menus2 as $menu2) {
95 99
 
96
-                    if($withPrivilege && !$this->checkPrivilege($roles_id, $menu2)) continue;
100
+                    if($withPrivilege && !$this->checkPrivilege($roles_id, $menu2)) {
101
+                        continue;
102
+                    }
97 103
 
98 104
                     $sidebarModel2 = $this->assignToModel($menu2);
99
-                    if($sidebarModel2->getisActive()) $menus2_active = true;
105
+                    if($sidebarModel2->getisActive()) {
106
+                        $menus2_active = true;
107
+                    }
100 108
 
101 109
                     if($menus3 = $this->loadData($menu2->id)) {
102 110
                         $sub2 = [];
103 111
                         $menus3_active = false;
104 112
                         foreach ($menus3 as $menu3) {
105 113
 
106
-                            if($withPrivilege && !$this->checkPrivilege($roles_id, $menu3)) continue;
114
+                            if($withPrivilege && !$this->checkPrivilege($roles_id, $menu3)) {
115
+                                continue;
116
+                            }
107 117
 
108 118
                             $sidebarModel3 = $this->assignToModel($menu3);
109 119
 
Please login to merge, or discard this patch.
src/types/file/FileController.php 1 patch
Braces   +3 added lines, -1 removed lines patch added patch discarded remove patch
@@ -14,7 +14,9 @@
 block discarded – undo
14 14
 {
15 15
     public function postUploadFile()
16 16
     {
17
-        if(auth()->guest()) return redirect(cb()->getLoginUrl());
17
+        if(auth()->guest()) {
18
+            return redirect(cb()->getLoginUrl());
19
+        }
18 20
 
19 21
         $file = null;
20 22
         try {
Please login to merge, or discard this patch.
src/types/image/ImageController.php 1 patch
Braces   +3 added lines, -1 removed lines patch added patch discarded remove patch
@@ -14,7 +14,9 @@
 block discarded – undo
14 14
 {
15 15
     public function postUploadImage()
16 16
     {
17
-        if(auth()->guest()) return redirect(cb()->getLoginUrl());
17
+        if(auth()->guest()) {
18
+            return redirect(cb()->getLoginUrl());
19
+        }
18 20
 
19 21
         $file = null;
20 22
         try {
Please login to merge, or discard this patch.