Passed
Push — master ( 38a665...decd12 )
by Ferry
05:33
created
src/types/checkbox/Checkbox.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -40,13 +40,13 @@  discard block
 block discarded – undo
40 40
      * @param $SQLCondition string|callable
41 41
      */
42 42
     public function optionsFromTable($table, $key_field, $display_field, $SQLCondition = null) {
43
-        if(strpos($table,"App\Models")!==false) {
43
+        if (strpos($table, "App\Models") !== false) {
44 44
             $table = new $table();
45 45
             $table = $table::$tableName;
46 46
         }
47 47
 
48 48
         $data = DB::table($table);
49
-        if($SQLCondition && is_callable($SQLCondition)) {
49
+        if ($SQLCondition && is_callable($SQLCondition)) {
50 50
             $data = call_user_func($SQLCondition, $data);
51 51
         }elseif ($SQLCondition && is_string($SQLCondition)) {
52 52
             $data->whereRaw($SQLCondition);
@@ -54,7 +54,7 @@  discard block
 block discarded – undo
54 54
         $data = $data->get();
55 55
         $options = [];
56 56
         foreach ($data as $d) {
57
-            $options[ $d->$key_field ] = $d->$display_field;
57
+            $options[$d->$key_field] = $d->$display_field;
58 58
         }
59 59
         $this->options($options);
60 60
     }
Please login to merge, or discard this patch.
src/controllers/CBController.php 1 patch
Spacing   +51 added lines, -51 removed lines patch added patch discarded remove patch
@@ -26,14 +26,14 @@  discard block
 block discarded – undo
26 26
 
27 27
     public function __call($method, $parameters)
28 28
     {
29
-        if($method == "getData") {
29
+        if ($method == "getData") {
30 30
             $key = $parameters[0];
31
-            if(isset($this->data[$key])) {
31
+            if (isset($this->data[$key])) {
32 32
                 return $this->data[$key];
33
-            }else{
33
+            } else {
34 34
                 return null;
35 35
             }
36
-        }else{
36
+        } else {
37 37
             return null;
38 38
         }
39 39
     }
@@ -47,13 +47,13 @@  discard block
 block discarded – undo
47 47
 
48 48
         $query->addSelect($this->data['table'].'.'.cb()->pk($this->data['table']).' as primary_key');
49 49
 
50
-        $softDelete = isset($this->data['disable_soft_delete'])?$this->data['disable_soft_delete']:true;
51
-        if($softDelete === true && Schema::hasColumn($this->data['table'],'deleted_at')) {
50
+        $softDelete = isset($this->data['disable_soft_delete']) ? $this->data['disable_soft_delete'] : true;
51
+        if ($softDelete === true && Schema::hasColumn($this->data['table'], 'deleted_at')) {
52 52
             $query->whereNull($this->data['table'].'.deleted_at');
53 53
         }
54 54
         
55
-        if(isset($joins)) {
56
-            foreach($joins as $join)
55
+        if (isset($joins)) {
56
+            foreach ($joins as $join)
57 57
             {
58 58
                 $query->join($join['target_table'],
59 59
                         $join['target_table_primary'],
@@ -63,14 +63,14 @@  discard block
 block discarded – undo
63 63
             }
64 64
         }
65 65
 
66
-        foreach($columns as $column) {
66
+        foreach ($columns as $column) {
67 67
             /** @var ColumnModel $column */
68
-            if($column->getType() != "custom") {
69
-                if(strpos($column->getField(),".") === false) {
70
-                    if(Schema::hasColumn($this->data['table'], $column->getField())) {
68
+            if ($column->getType() != "custom") {
69
+                if (strpos($column->getField(), ".") === false) {
70
+                    if (Schema::hasColumn($this->data['table'], $column->getField())) {
71 71
                         $query->addSelect($this->data['table'].'.'.$column->getField());
72 72
                     }
73
-                }else{
73
+                } else {
74 74
                     $query->addSelect($column->getField());
75 75
                 }
76 76
             }
@@ -78,20 +78,20 @@  discard block
 block discarded – undo
78 78
             $query = getTypeHook($column->getType())->query($query, $column);
79 79
         }
80 80
 
81
-        if(request()->has('q'))
81
+        if (request()->has('q'))
82 82
         {
83
-            if(isset($this->data['hook_search_query'])) {
83
+            if (isset($this->data['hook_search_query'])) {
84 84
                 $query = call_user_func($this->data['hook_search_query'], $query);
85
-            }else{
86
-                $query->where(function ($where) use ($columns) {
85
+            } else {
86
+                $query->where(function($where) use ($columns) {
87 87
                     /**
88 88
                      * @var $where Builder
89 89
                      */
90
-                    foreach($columns as $column)
90
+                    foreach ($columns as $column)
91 91
                     {
92
-                        if(strpos($column->getField(),".") === false) {
92
+                        if (strpos($column->getField(), ".") === false) {
93 93
                             $field = $this->data['table'].'.'.$column->getField();
94
-                        }else{
94
+                        } else {
95 95
                             $field = $column->getField();
96 96
                         }
97 97
                         $where->orWhere($field, 'like', '%'.request('q').'%');
@@ -100,17 +100,17 @@  discard block
 block discarded – undo
100 100
             }
101 101
         }
102 102
 
103
-        if(isset($this->data['hook_index_query']) && is_callable($this->data['hook_index_query'])) {
103
+        if (isset($this->data['hook_index_query']) && is_callable($this->data['hook_index_query'])) {
104 104
             $query = call_user_func($this->data['hook_index_query'], $query);
105 105
         }
106 106
 
107 107
 
108
-        if(request()->has(['order_by','order_sort']))
108
+        if (request()->has(['order_by', 'order_sort']))
109 109
         {
110
-            if(in_array(request('order_by'),columnSingleton()->getColumnNameOnly())) {
110
+            if (in_array(request('order_by'), columnSingleton()->getColumnNameOnly())) {
111 111
                 $query->orderBy(request('order_by'), request('order_sort'));
112 112
             }
113
-        }else{
113
+        } else {
114 114
             $query->orderBy($this->data['table'].'.'.cb()->findPrimaryKey($this->data['table']), "desc");
115 115
         }
116 116
 
@@ -119,10 +119,10 @@  discard block
 block discarded – undo
119 119
 
120 120
     public function getIndex()
121 121
     {
122
-        if(!module()->canBrowse()) return cb()->redirect(cb()->getAdminUrl(),"You do not have a privilege access to this area");
122
+        if (!module()->canBrowse()) return cb()->redirect(cb()->getAdminUrl(), "You do not have a privilege access to this area");
123 123
 
124 124
         $query = $this->repository();
125
-        $result = $query->paginate( request("limit")?:cbConfig("LIMIT_TABLE_DATA") );
125
+        $result = $query->paginate(request("limit") ?: cbConfig("LIMIT_TABLE_DATA"));
126 126
         $data['result'] = $result;
127 127
 
128 128
         return view("crudbooster::module.index.index", array_merge($data, $this->data));
@@ -134,29 +134,29 @@  discard block
 block discarded – undo
134 134
      */
135 135
     private function validation()
136 136
     {
137
-        if(isset($this->data['validation'])) {
137
+        if (isset($this->data['validation'])) {
138 138
             $validator = Validator::make(request()->all(), @$this->data['validation'], @$this->data['validation_messages']);
139 139
             if ($validator->fails()) {
140 140
                 $message = $validator->messages();
141 141
                 $message_all = $message->all();
142
-                throw new CBValidationException(implode(', ',$message_all));
142
+                throw new CBValidationException(implode(', ', $message_all));
143 143
             }
144 144
         }
145 145
     }
146 146
 
147 147
     public function getAdd()
148 148
     {
149
-        if(!module()->canCreate()) return cb()->redirect(cb()->getAdminUrl(),"You do not have a privilege access to this area");
149
+        if (!module()->canCreate()) return cb()->redirect(cb()->getAdminUrl(), "You do not have a privilege access to this area");
150 150
 
151 151
         $data = [];
152 152
         $data['page_title'] = $this->data['page_title'].' : Add';
153 153
         $data['action_url'] = module()->addSaveURL();
154
-        return view('crudbooster::module.form.form',array_merge($data, $this->data));
154
+        return view('crudbooster::module.form.form', array_merge($data, $this->data));
155 155
     }
156 156
 
157 157
     public function postAddSave()
158 158
     {
159
-        if(!module()->canCreate()) return cb()->redirect(cb()->getAdminUrl(),"You do not have a privilege access to this area");
159
+        if (!module()->canCreate()) return cb()->redirect(cb()->getAdminUrl(), "You do not have a privilege access to this area");
160 160
 
161 161
         try {
162 162
             $this->validation();
@@ -164,28 +164,28 @@  discard block
 block discarded – undo
164 164
             $data = columnSingleton()->getAssignmentData();
165 165
 
166 166
             //Clear data from Primary Key
167
-            unset($data[ cb()->pk($this->data['table']) ]);
167
+            unset($data[cb()->pk($this->data['table'])]);
168 168
 
169
-            if(Schema::hasColumn($this->data['table'], 'created_at')) {
169
+            if (Schema::hasColumn($this->data['table'], 'created_at')) {
170 170
                 $data['created_at'] = date('Y-m-d H:i:s');
171 171
             }
172 172
 
173
-            if(isset($this->data['hook_before_insert']) && is_callable($this->data['hook_before_insert'])) {
173
+            if (isset($this->data['hook_before_insert']) && is_callable($this->data['hook_before_insert'])) {
174 174
                 $data = call_user_func($this->data['hook_before_insert'], $data);
175 175
             }
176 176
 
177 177
             $id = DB::table($this->data['table'])->insertGetId($data);
178 178
 
179
-            if(isset($this->data['hook_after_insert']) && is_callable($this->data['hook_after_insert'])) {
179
+            if (isset($this->data['hook_after_insert']) && is_callable($this->data['hook_after_insert'])) {
180 180
                 call_user_func($this->data['hook_after_insert'], $id);
181 181
             }
182 182
 
183 183
         } catch (CBValidationException $e) {
184 184
             Log::debug($e);
185
-            return cb()->redirectBack($e->getMessage(),'info');
185
+            return cb()->redirectBack($e->getMessage(), 'info');
186 186
         } catch (\Exception $e) {
187 187
             Log::error($e);
188
-            return cb()->redirectBack($e->getMessage(),'warning');
188
+            return cb()->redirectBack($e->getMessage(), 'warning');
189 189
         }
190 190
 
191 191
         if (request('submit') == trans('crudbooster.button_save_more')) {
@@ -197,7 +197,7 @@  discard block
 block discarded – undo
197 197
 
198 198
     public function getEdit($id)
199 199
     {
200
-        if(!module()->canUpdate()) return cb()->redirect(cb()->getAdminUrl(),"You do not have a privilege access to this area");
200
+        if (!module()->canUpdate()) return cb()->redirect(cb()->getAdminUrl(), "You do not have a privilege access to this area");
201 201
 
202 202
         $data = [];
203 203
         $data['row'] = $this->repository()->where($this->data['table'].'.'.getPrimaryKey($this->data['table']), $id)->first();
@@ -208,7 +208,7 @@  discard block
 block discarded – undo
208 208
 
209 209
     public function postEditSave($id)
210 210
     {
211
-        if(!module()->canUpdate()) return cb()->redirect(cb()->getAdminUrl(),"You do not have a privilege access to this area");
211
+        if (!module()->canUpdate()) return cb()->redirect(cb()->getAdminUrl(), "You do not have a privilege access to this area");
212 212
 
213 213
         try {
214 214
             $this->validation();
@@ -216,13 +216,13 @@  discard block
 block discarded – undo
216 216
             $data = columnSingleton()->getAssignmentData();
217 217
 
218 218
             //Clear data from Primary Key
219
-            unset($data[ cb()->pk($this->data['table']) ]);
219
+            unset($data[cb()->pk($this->data['table'])]);
220 220
 
221
-            if(Schema::hasColumn($this->data['table'], 'updated_at')) {
221
+            if (Schema::hasColumn($this->data['table'], 'updated_at')) {
222 222
                 $data['updated_at'] = date('Y-m-d H:i:s');
223 223
             }
224 224
 
225
-            if(isset($this->data['hook_before_update']) && is_callable($this->data['hook_before_update'])) {
225
+            if (isset($this->data['hook_before_update']) && is_callable($this->data['hook_before_update'])) {
226 226
                 $data = call_user_func($this->data['hook_before_update'], $id, $data);
227 227
             }
228 228
 
@@ -230,16 +230,16 @@  discard block
 block discarded – undo
230 230
                 ->where(cb()->pk($this->data['table']), $id)
231 231
                 ->update($data);
232 232
 
233
-            if(isset($this->data['hook_after_update']) && is_callable($this->data['hook_after_update'])) {
233
+            if (isset($this->data['hook_after_update']) && is_callable($this->data['hook_after_update'])) {
234 234
                 call_user_func($this->data['hook_after_update'], $id);
235 235
             }
236 236
 
237 237
         } catch (CBValidationException $e) {
238 238
             Log::debug($e);
239
-            return cb()->redirectBack($e->getMessage(),'info');
239
+            return cb()->redirectBack($e->getMessage(), 'info');
240 240
         } catch (\Exception $e) {
241 241
             Log::error($e);
242
-            return cb()->redirectBack($e->getMessage(),'warning');
242
+            return cb()->redirectBack($e->getMessage(), 'warning');
243 243
         }
244 244
 
245 245
 
@@ -252,15 +252,15 @@  discard block
 block discarded – undo
252 252
 
253 253
     public function getDelete($id)
254 254
     {
255
-        if(!module()->canDelete()) return cb()->redirect(cb()->getAdminUrl(),"You do not have a privilege access to this area");
255
+        if (!module()->canDelete()) return cb()->redirect(cb()->getAdminUrl(), "You do not have a privilege access to this area");
256 256
 
257
-        if(isset($this->data['hook_before_delete']) && is_callable($this->data['hook_before_delete'])) {
257
+        if (isset($this->data['hook_before_delete']) && is_callable($this->data['hook_before_delete'])) {
258 258
             call_user_func($this->data['hook_before_delete'], $id);
259 259
         }
260 260
 
261
-        $softDelete = isset($this->data['disable_soft_delete'])?$this->data['disable_soft_delete']:true;
261
+        $softDelete = isset($this->data['disable_soft_delete']) ? $this->data['disable_soft_delete'] : true;
262 262
 
263
-        if ($softDelete === true && Schema::hasColumn($this->data['table'],'deleted_at')) {
263
+        if ($softDelete === true && Schema::hasColumn($this->data['table'], 'deleted_at')) {
264 264
             DB::table($this->data['table'])
265 265
                 ->where(getPrimaryKey($this->data['table']), $id)
266 266
                 ->update(['deleted_at' => date('Y-m-d H:i:s')]);
@@ -270,7 +270,7 @@  discard block
 block discarded – undo
270 270
                 ->delete();
271 271
         }
272 272
 
273
-        if(isset($this->data['hook_after_delete']) && is_callable($this->data['hook_after_delete'])) {
273
+        if (isset($this->data['hook_after_delete']) && is_callable($this->data['hook_after_delete'])) {
274 274
             call_user_func($this->data['hook_after_delete'], $id);
275 275
         }
276 276
 
@@ -279,7 +279,7 @@  discard block
 block discarded – undo
279 279
 
280 280
     public function getDetail($id)
281 281
     {
282
-        if(!module()->canRead()) return cb()->redirect(cb()->getAdminUrl(),"You do not have a privilege access to this area");
282
+        if (!module()->canRead()) return cb()->redirect(cb()->getAdminUrl(), "You do not have a privilege access to this area");
283 283
 
284 284
         $data = [];
285 285
         $data['row'] = $this->repository()->where($this->data['table'].'.'.getPrimaryKey($this->data['table']), $id)->first();
Please login to merge, or discard this patch.
src/controllers/DeveloperMenusController.php 1 patch
Spacing   +23 added lines, -23 removed lines patch added patch discarded remove patch
@@ -24,22 +24,22 @@  discard block
 block discarded – undo
24 24
 
25 25
     public function getIndex() {
26 26
         $data = [];
27
-        return view($this->view.".index",$data);
27
+        return view($this->view.".index", $data);
28 28
     }
29 29
 
30 30
     public function getAdd() {
31 31
         $data = [];
32 32
         $data['form_title'] = "Add Menu";
33 33
         $data['form_url'] = route('DeveloperMenusControllerPostAddSave');
34
-        $data['modules'] = DB::table("cb_modules")->orderBy("name","asc")->get();
34
+        $data['modules'] = DB::table("cb_modules")->orderBy("name", "asc")->get();
35 35
         return view($this->view.".form", $data);
36 36
     }
37 37
 
38 38
     public function getEdit($id) {
39 39
         $data = [];
40 40
         $data['form_title'] = "Edit Menu";
41
-        $data['form_url'] = route('DeveloperMenusControllerPostEditSave',['id'=>$id]);
42
-        $data['modules'] = DB::table("cb_modules")->orderBy("name","asc")->get();
41
+        $data['form_url'] = route('DeveloperMenusControllerPostEditSave', ['id'=>$id]);
42
+        $data['modules'] = DB::table("cb_modules")->orderBy("name", "asc")->get();
43 43
         $data['row'] = cb()->find("cb_menus", $id);
44 44
         return view($this->view.".form", $data);
45 45
     }
@@ -52,7 +52,7 @@  discard block
 block discarded – undo
52 52
             $menu['name'] = request('name');
53 53
             $menu['icon'] = request('icon');
54 54
             $menu['type'] = request('type');
55
-            if(request('type') == 'module') {
55
+            if (request('type') == 'module') {
56 56
                 $menu['cb_modules_id'] = request('cb_modules_id');
57 57
             }elseif (request('type') == 'url') {
58 58
                 $menu['path'] = request('url_value');
@@ -62,7 +62,7 @@  discard block
 block discarded – undo
62 62
 
63 63
             DB::table("cb_menus")->insert($menu);
64 64
 
65
-            return cb()->redirect(route("DeveloperMenusControllerGetIndex"),"The menu has been added!","success");
65
+            return cb()->redirect(route("DeveloperMenusControllerGetIndex"), "The menu has been added!", "success");
66 66
 
67 67
         } catch (CBValidationException $e) {
68 68
             return cb()->redirectBack($e->getMessage());
@@ -77,16 +77,16 @@  discard block
 block discarded – undo
77 77
             $menu['name'] = request('name');
78 78
             $menu['icon'] = request('icon');
79 79
             $menu['type'] = request('type');
80
-            if(request('type') == 'module') {
80
+            if (request('type') == 'module') {
81 81
                 $menu['cb_modules_id'] = request('cb_modules_id');
82 82
             }elseif (request('type') == 'url') {
83 83
                 $menu['path'] = request('url_value');
84 84
             }elseif (request('type') == 'path') {
85 85
                 $menu['path'] = request('path_value');
86 86
             }
87
-            DB::table("cb_menus")->where("id",$id)->update($menu);
87
+            DB::table("cb_menus")->where("id", $id)->update($menu);
88 88
 
89
-            return cb()->redirect(route("DeveloperMenusControllerGetIndex"),"The menu has been saved!","success");
89
+            return cb()->redirect(route("DeveloperMenusControllerGetIndex"), "The menu has been saved!", "success");
90 90
 
91 91
         } catch (CBValidationException $e) {
92 92
             return cb()->redirectBack($e->getMessage());
@@ -99,20 +99,20 @@  discard block
 block discarded – undo
99 99
 
100 100
             $menus = request('menus');
101 101
             $menus = json_decode($menus, true);
102
-            if($menus) {
102
+            if ($menus) {
103 103
                 $menus = $menus[0];
104
-                if($menus) {
105
-                    foreach($menus as $i=>$menu) {
104
+                if ($menus) {
105
+                    foreach ($menus as $i=>$menu) {
106 106
                         $id = $menu['id'];
107
-                        cb()->update("cb_menus",$id,["sort_number"=>$i,'parent_cb_menus_id'=>null]);
108
-                        if($menu['children'][0]) {
109
-                            foreach($menu['children'][0] as $ii=>$sub) {
107
+                        cb()->update("cb_menus", $id, ["sort_number"=>$i, 'parent_cb_menus_id'=>null]);
108
+                        if ($menu['children'][0]) {
109
+                            foreach ($menu['children'][0] as $ii=>$sub) {
110 110
                                 $id = $sub['id'];
111
-                                cb()->update("cb_menus",$id,["sort_number"=>$ii,"parent_cb_menus_id"=>$menu['id']]);
112
-                                if($sub['children'][0]) {
113
-                                    foreach($sub['children'][0] as $iii=>$subsub) {
111
+                                cb()->update("cb_menus", $id, ["sort_number"=>$ii, "parent_cb_menus_id"=>$menu['id']]);
112
+                                if ($sub['children'][0]) {
113
+                                    foreach ($sub['children'][0] as $iii=>$subsub) {
114 114
                                         $id = $subsub['id'];
115
-                                        cb()->update("cb_menus",$id,["sort_number"=>$iii,"parent_cb_menus_id"=>$sub['id']]);
115
+                                        cb()->update("cb_menus", $id, ["sort_number"=>$iii, "parent_cb_menus_id"=>$sub['id']]);
116 116
                                     }
117 117
                                 }
118 118
                             }
@@ -121,17 +121,17 @@  discard block
 block discarded – undo
121 121
                 }
122 122
             }
123 123
 
124
-            return response()->json(['api_status'=>1,'api_message'=>'success']);
124
+            return response()->json(['api_status'=>1, 'api_message'=>'success']);
125 125
 
126 126
         } catch (CBValidationException $e) {
127
-            return response()->json(['api_status'=>0,'api_message'=>$e->getMessage()]);
127
+            return response()->json(['api_status'=>0, 'api_message'=>$e->getMessage()]);
128 128
         }
129 129
     }
130 130
 
131 131
     public function getDelete($id) {
132
-        DB::table("cb_menus")->where("id",$id)->delete();
132
+        DB::table("cb_menus")->where("id", $id)->delete();
133 133
 
134
-        return cb()->redirectBack("The menu has been deleted!","success");
134
+        return cb()->redirectBack("The menu has been deleted!", "success");
135 135
     }
136 136
 
137 137
 }
138 138
\ No newline at end of file
Please login to merge, or discard this patch.
src/helpers/Module.php 1 patch
Spacing   +49 added lines, -49 removed lines patch added patch discarded remove patch
@@ -26,16 +26,16 @@  discard block
 block discarded – undo
26 26
         try {
27 27
             $routeArray = request()->route()->getAction();
28 28
             $this->controller = class_basename($routeArray['controller']);
29
-            $this->controller = strtok($this->controller,"@");
29
+            $this->controller = strtok($this->controller, "@");
30 30
 
31 31
             $className = "\\".$routeArray["namespace"]."\\".$this->controller;
32
-            if(class_exists($className)) {
33
-                $this->module = cb()->find("cb_modules",["controller"=>$this->controller]);
34
-                if($this->module) {
32
+            if (class_exists($className)) {
33
+                $this->module = cb()->find("cb_modules", ["controller"=>$this->controller]);
34
+                if ($this->module) {
35 35
                     $this->controller_class = new $className();
36
-                    $this->menu = cb()->find("cb_menus",["cb_modules_id"=>$this->module->id]);
37
-                    $this->menu = (!$this->menu)?cb()->find("cb_menus",["type"=>"path","path"=>request()->segment(2)]):$this->menu;
38
-                    if($this->menu) {
36
+                    $this->menu = cb()->find("cb_menus", ["cb_modules_id"=>$this->module->id]);
37
+                    $this->menu = (!$this->menu) ?cb()->find("cb_menus", ["type"=>"path", "path"=>request()->segment(2)]) : $this->menu;
38
+                    if ($this->menu) {
39 39
                         $this->privilege = DB::table("cb_role_privileges")
40 40
                             ->where("cb_menus_id", $this->menu->id)
41 41
                             ->where("cb_roles_id", cb()->session()->roleId())
@@ -57,9 +57,9 @@  discard block
 block discarded – undo
57 57
     }
58 58
 
59 59
     public function getData($key) {
60
-        if($this->controller_class) {
60
+        if ($this->controller_class) {
61 61
             $value = $this->controller_class->getData($key);
62
-            if(isset($value)) {
62
+            if (isset($value)) {
63 63
                 return $value;
64 64
             }
65 65
         }
@@ -70,128 +70,128 @@  discard block
 block discarded – undo
70 70
      * @return CBController
71 71
      */
72 72
     public function getController() {
73
-        return ($this->controller_class)?$this->controller_class:null;
73
+        return ($this->controller_class) ? $this->controller_class : null;
74 74
     }
75 75
 
76 76
     public function getPageTitle()
77 77
     {
78
-        return ($this->controller_class)?$this->controller_class->getData("page_title")?:cb()->getAppName():null;
78
+        return ($this->controller_class) ? $this->controller_class->getData("page_title") ?: cb()->getAppName() : null;
79 79
     }
80 80
 
81 81
     public function getTable()
82 82
     {
83
-        return ($this->controller_class)?$this->controller_class->getData("table"):null;
83
+        return ($this->controller_class) ? $this->controller_class->getData("table") : null;
84 84
     }
85 85
 
86 86
     public function getPageIcon()
87 87
     {
88
-        return ($this->controller_class)?$this->controller_class->getData('page_icon')?:"fa fa-bars":null;
88
+        return ($this->controller_class) ? $this->controller_class->getData('page_icon') ?: "fa fa-bars" : null;
89 89
     }
90 90
 
91 91
     public function canBrowse() {
92
-        if($this->privilege) {
93
-            if($this->privilege->can_browse) return true;
92
+        if ($this->privilege) {
93
+            if ($this->privilege->can_browse) return true;
94 94
             else return false;
95
-        }else{
95
+        } else {
96 96
             return true;
97 97
         }
98 98
     }
99 99
 
100 100
     public function canCreate() {
101
-        if($this->privilege) {
102
-            if($this->privilege->can_create) return true;
101
+        if ($this->privilege) {
102
+            if ($this->privilege->can_create) return true;
103 103
             else return false;
104
-        }else{
104
+        } else {
105 105
             return true;
106 106
         }
107 107
     }
108 108
 
109 109
     public function canRead() {
110
-        if($this->privilege) {
111
-            if($this->privilege->can_read) return true;
110
+        if ($this->privilege) {
111
+            if ($this->privilege->can_read) return true;
112 112
             else return false;
113
-        }else{
113
+        } else {
114 114
             return true;
115 115
         }
116 116
     }
117 117
 
118 118
     public function canUpdate() {
119
-        if($this->privilege) {
120
-            if($this->privilege->can_update) return true;
119
+        if ($this->privilege) {
120
+            if ($this->privilege->can_update) return true;
121 121
             else return false;
122
-        }else{
122
+        } else {
123 123
             return true;
124 124
         }
125 125
     }
126 126
 
127 127
     public function canDelete() {
128
-        if($this->privilege) {
129
-            if($this->privilege->can_delete) return true;
128
+        if ($this->privilege) {
129
+            if ($this->privilege->can_delete) return true;
130 130
             else return false;
131
-        }else{
131
+        } else {
132 132
             return true;
133 133
         }
134 134
     }
135 135
 
136 136
     public function addURL()
137 137
     {
138
-        if($this->controller_class && method_exists($this->controller_class, 'getAdd')) {
138
+        if ($this->controller_class && method_exists($this->controller_class, 'getAdd')) {
139 139
             return action($this->controller.'@getAdd');
140
-        }else{
140
+        } else {
141 141
             return null;
142 142
         }
143 143
     }
144 144
 
145 145
     public function addSaveURL()
146 146
     {
147
-        if($this->controller_class && method_exists($this->controller_class, 'postAddSave')) {
147
+        if ($this->controller_class && method_exists($this->controller_class, 'postAddSave')) {
148 148
             return action($this->controller.'@postAddSave');
149
-        }else{
149
+        } else {
150 150
             return null;
151 151
         }
152 152
     }
153 153
 
154 154
     public function editURL($id = null)
155 155
     {
156
-        if($this->controller_class && method_exists($this->controller_class, 'getEdit')) {
157
-            return action($this->controller.'@getEdit',['id'=>$id]);
158
-        }else{
156
+        if ($this->controller_class && method_exists($this->controller_class, 'getEdit')) {
157
+            return action($this->controller.'@getEdit', ['id'=>$id]);
158
+        } else {
159 159
             return null;
160 160
         }
161 161
     }
162 162
 
163 163
     public function editSaveURL($id = null)
164 164
     {
165
-        if(method_exists($this->controller_class, 'postEditSave')) {
166
-            return action($this->controller.'@postEditSave',['id'=>$id]);
167
-        }else{
165
+        if (method_exists($this->controller_class, 'postEditSave')) {
166
+            return action($this->controller.'@postEditSave', ['id'=>$id]);
167
+        } else {
168 168
             return null;
169 169
         }
170 170
     }
171 171
 
172
-    public function detailURL($id=null)
172
+    public function detailURL($id = null)
173 173
     {
174
-        if($this->controller_class && method_exists($this->controller_class, 'getDetail')) {
175
-            return action($this->controller.'@getDetail',['id'=>$id]);
176
-        }else{
174
+        if ($this->controller_class && method_exists($this->controller_class, 'getDetail')) {
175
+            return action($this->controller.'@getDetail', ['id'=>$id]);
176
+        } else {
177 177
             return null;
178 178
         }
179 179
     }
180 180
 
181
-    public function deleteURL($id=null)
181
+    public function deleteURL($id = null)
182 182
     {
183
-        if($this->controller_class && method_exists($this->controller_class, 'getDelete')) {
184
-            return action($this->controller.'@getDelete',['id'=>$id]);
185
-        }else{
183
+        if ($this->controller_class && method_exists($this->controller_class, 'getDelete')) {
184
+            return action($this->controller.'@getDelete', ['id'=>$id]);
185
+        } else {
186 186
             return null;
187 187
         }
188 188
     }
189 189
 
190 190
     public function url($path = null)
191 191
     {
192
-        if($this->controller_class && method_exists($this->controller_class, 'getIndex')) {
193
-            return trim(action($this->controller.'@getIndex').'/'.$path,'/');
194
-        }else{
192
+        if ($this->controller_class && method_exists($this->controller_class, 'getIndex')) {
193
+            return trim(action($this->controller.'@getIndex').'/'.$path, '/');
194
+        } else {
195 195
             return null;
196 196
         }
197 197
     }
Please login to merge, or discard this patch.
src/controllers/AdminAuthController.php 1 patch
Spacing   +11 added lines, -11 removed lines patch added patch discarded remove patch
@@ -8,7 +8,7 @@  discard block
 block discarded – undo
8 8
 
9 9
     public function getLogin()
10 10
     {
11
-        if(!auth()->guest()) return redirect(cb()->getAdminUrl());
11
+        if (!auth()->guest()) return redirect(cb()->getAdminUrl());
12 12
 
13 13
         cbHook()->hookGetLogin();
14 14
 
@@ -17,20 +17,20 @@  discard block
 block discarded – undo
17 17
 
18 18
     public function postLogin()
19 19
     {
20
-        try{
20
+        try {
21 21
             cb()->validation([
22 22
                 'email'=>'required|email',
23 23
                 'password'=>'required'
24 24
             ]);
25
-            $credential = request()->only(['email','password']);
25
+            $credential = request()->only(['email', 'password']);
26 26
             if (auth()->attempt($credential)) {
27 27
                 cbHook()->hookPostLogin();
28 28
                 return redirect(cb()->getAdminUrl());
29 29
             } else {
30
-                return redirect(cb()->getLoginUrl())->with(['message'=>__('crudbooster.password_and_username_is_wrong'),'message_type'=>'warning']);
30
+                return redirect(cb()->getLoginUrl())->with(['message'=>__('crudbooster.password_and_username_is_wrong'), 'message_type'=>'warning']);
31 31
             }
32
-        }catch (CBValidationException $e) {
33
-            return cb()->redirect(cb()->getAdminUrl("login"),$e->getMessage(),'warning');
32
+        } catch (CBValidationException $e) {
33
+            return cb()->redirect(cb()->getAdminUrl("login"), $e->getMessage(), 'warning');
34 34
         }
35 35
     }
36 36
 
@@ -45,25 +45,25 @@  discard block
 block discarded – undo
45 45
     }
46 46
 
47 47
     public function postLoginDeveloper() {
48
-        try{
48
+        try {
49 49
             cb()->validation([
50 50
                 'username'=>'required',
51 51
                 'password'=>'required'
52 52
             ]);
53 53
 
54
-            if(request('username') == getSetting('developer_username')
54
+            if (request('username') == getSetting('developer_username')
55 55
                 && request('password') == getSetting("developer_password")) {
56 56
 
57 57
                 session(['developer'=>1]);
58 58
 
59 59
                 return redirect(cb()->getDeveloperUrl());
60 60
 
61
-            }else{
61
+            } else {
62 62
                 return cb()->redirectBack(__("crudbooster.password_and_username_is_wrong"));
63 63
             }
64 64
 
65
-        }catch (CBValidationException $e) {
66
-            return cb()->redirect(cb()->getLoginUrl(),$e->getMessage(),'warning');
65
+        } catch (CBValidationException $e) {
66
+            return cb()->redirect(cb()->getLoginUrl(), $e->getMessage(), 'warning');
67 67
         }
68 68
     }
69 69
 
Please login to merge, or discard this patch.
src/controllers/DeveloperRolesController.php 1 patch
Spacing   +26 added lines, -26 removed lines patch added patch discarded remove patch
@@ -25,12 +25,12 @@  discard block
 block discarded – undo
25 25
     public function getIndex() {
26 26
         $data = [];
27 27
         $data['result'] = DB::table("cb_roles")->get();
28
-        return view($this->view.".index",$data);
28
+        return view($this->view.".index", $data);
29 29
     }
30 30
 
31 31
     public function getAdd() {
32 32
         $data = [];
33
-        $data['menus'] = DB::table("cb_menus")->orderBy("name","asc")->get();
33
+        $data['menus'] = DB::table("cb_menus")->orderBy("name", "asc")->get();
34 34
         return view($this->view.".add", $data);
35 35
     }
36 36
 
@@ -49,17 +49,17 @@  discard block
 block discarded – undo
49 49
                 $privilege = [];
50 50
                 $privilege["cb_roles_id"] = $roles_id;
51 51
                 $privilege["cb_menus_id"] = $menus_id;
52
-                $privilege["can_browse"]  = @$access['can_browse']?:0;
53
-                $privilege["can_create"] = @$access['can_create']?:0;
54
-                $privilege["can_read"] = @$access['can_read']?:0;
55
-                $privilege["can_update"] = @$access['can_update']?:0;
56
-                $privilege["can_delete"] = @$access['can_delete']?:0;
52
+                $privilege["can_browse"]  = @$access['can_browse'] ?: 0;
53
+                $privilege["can_create"] = @$access['can_create'] ?: 0;
54
+                $privilege["can_read"] = @$access['can_read'] ?: 0;
55
+                $privilege["can_update"] = @$access['can_update'] ?: 0;
56
+                $privilege["can_delete"] = @$access['can_delete'] ?: 0;
57 57
                 DB::table("cb_role_privileges")->insert($privilege);
58 58
             }
59 59
 
60 60
             DB::commit();
61 61
 
62
-            return cb()->redirect(route("DeveloperRolesControllerGetIndex"),"The role has been saved!","success");
62
+            return cb()->redirect(route("DeveloperRolesControllerGetIndex"), "The role has been saved!", "success");
63 63
 
64 64
         } catch (CBValidationException $e) {
65 65
             return cb()->redirectBack($e->getMessage());
@@ -74,21 +74,21 @@  discard block
 block discarded – undo
74 74
         $data['row'] = cb()->find("cb_roles", $id);
75 75
 
76 76
         $menus = DB::table("cb_menus")
77
-        ->leftjoin("cb_role_privileges",function($join) use ($id) {
78
-            $join->on("cb_role_privileges.cb_menus_id","=","cb_menus.id")->where("cb_role_privileges.cb_roles_id", $id);
77
+        ->leftjoin("cb_role_privileges", function($join) use ($id) {
78
+            $join->on("cb_role_privileges.cb_menus_id", "=", "cb_menus.id")->where("cb_role_privileges.cb_roles_id", $id);
79 79
         })
80
-        ->orderBy("cb_menus.name","asc")
81
-        ->select("cb_menus.*","can_browse","can_create","can_read","can_update","can_delete")
80
+        ->orderBy("cb_menus.name", "asc")
81
+        ->select("cb_menus.*", "can_browse", "can_create", "can_read", "can_update", "can_delete")
82 82
         ->get();
83 83
         $data['menus'] = $menus;
84 84
 
85
-        return view($this->view.".edit",$data);
85
+        return view($this->view.".edit", $data);
86 86
     }
87 87
 
88 88
     private function existsPrivilege($cb_roles_id, $cb_menus_id) {
89
-        if($row = cb()->find("cb_role_privileges",['cb_roles_id'=>$cb_roles_id,'cb_menus_id'=>$cb_menus_id])) {
89
+        if ($row = cb()->find("cb_role_privileges", ['cb_roles_id'=>$cb_roles_id, 'cb_menus_id'=>$cb_menus_id])) {
90 90
             return $row->id;
91
-        }else{
91
+        } else {
92 92
             return null;
93 93
         }
94 94
     }
@@ -97,26 +97,26 @@  discard block
 block discarded – undo
97 97
         try {
98 98
             cb()->validation(['name', 'menus']);
99 99
 
100
-            cb()->updateCompact("cb_roles",$id,['name']);
100
+            cb()->updateCompact("cb_roles", $id, ['name']);
101 101
 
102 102
             foreach (request("menus") as $menus_id) {
103 103
                 @$access = request("access")[$menus_id];
104 104
                 $privilege = [];
105 105
                 $privilege["cb_roles_id"] = $id;
106 106
                 $privilege["cb_menus_id"] = $menus_id;
107
-                $privilege["can_browse"]  = @$access['can_browse']?:0;
108
-                $privilege["can_create"] = @$access['can_create']?:0;
109
-                $privilege["can_read"] = @$access['can_read']?:0;
110
-                $privilege["can_update"] = @$access['can_update']?:0;
111
-                $privilege["can_delete"] = @$access['can_delete']?:0;
112
-                if($privilege_id = $this->existsPrivilege($id, $menus_id)) {
107
+                $privilege["can_browse"]  = @$access['can_browse'] ?: 0;
108
+                $privilege["can_create"] = @$access['can_create'] ?: 0;
109
+                $privilege["can_read"] = @$access['can_read'] ?: 0;
110
+                $privilege["can_update"] = @$access['can_update'] ?: 0;
111
+                $privilege["can_delete"] = @$access['can_delete'] ?: 0;
112
+                if ($privilege_id = $this->existsPrivilege($id, $menus_id)) {
113 113
                     DB::table("cb_role_privileges")->where("id", $privilege_id)->update($privilege);
114
-                }else{
114
+                } else {
115 115
                     DB::table("cb_role_privileges")->insert($privilege);
116 116
                 }
117 117
             }
118 118
 
119
-            return cb()->redirect(route("DeveloperRolesControllerGetIndex"),"The role has been saved!","success");
119
+            return cb()->redirect(route("DeveloperRolesControllerGetIndex"), "The role has been saved!", "success");
120 120
 
121 121
         } catch (CBValidationException $e) {
122 122
 
@@ -126,9 +126,9 @@  discard block
 block discarded – undo
126 126
 
127 127
     public function getDelete($id) {
128 128
         DB::table("cb_roles")->where("id", $id)->delete();
129
-        DB::table("cb_role_privileges")->where("cb_roles_id",$id)->delete();
129
+        DB::table("cb_role_privileges")->where("cb_roles_id", $id)->delete();
130 130
 
131
-        return cb()->redirect(route("DeveloperRolesControllerGetIndex"), "The role has been deleted!","success");
131
+        return cb()->redirect(route("DeveloperRolesControllerGetIndex"), "The role has been deleted!", "success");
132 132
     }
133 133
 
134 134
 }
135 135
\ No newline at end of file
Please login to merge, or discard this patch.
src/controllers/scaffolding/traits/ColumnsRegister.php 1 patch
Spacing   +38 added lines, -38 removed lines patch added patch discarded remove patch
@@ -59,8 +59,8 @@  discard block
 block discarded – undo
59 59
         $data = new TextModel();
60 60
         $data = $this->setDefaultModelValue($data);
61 61
         $data->setLabel($label);
62
-        $data->setName($this->name($label,$name));
63
-        $data->setField($field_to_save?:$this->name($label, $name));
62
+        $data->setName($this->name($label, $name));
63
+        $data->setField($field_to_save ?: $this->name($label, $name));
64 64
         $data->setType("text");
65 65
 
66 66
         columnSingleton()->setColumn($this->index, $data);
@@ -75,8 +75,8 @@  discard block
 block discarded – undo
75 75
         $data = new CheckboxModel();
76 76
         $data = $this->setDefaultModelValue($data);
77 77
         $data->setLabel($label);
78
-        $data->setName($this->name($label,$name));
79
-        $data->setField($field_to_save?:$this->name($label, $name));
78
+        $data->setName($this->name($label, $name));
79
+        $data->setField($field_to_save ?: $this->name($label, $name));
80 80
         $data->setType("checkbox");
81 81
 
82 82
         columnSingleton()->setColumn($this->index, $data);
@@ -91,8 +91,8 @@  discard block
 block discarded – undo
91 91
         $data = new PasswordModel();
92 92
         $data = $this->setDefaultModelValue($data);
93 93
         $data->setLabel($label);
94
-        $data->setName($this->name($label,$name));
95
-        $data->setField($field_to_save?:$this->name($label, $name));
94
+        $data->setName($this->name($label, $name));
95
+        $data->setField($field_to_save ?: $this->name($label, $name));
96 96
         $data->setType("password");
97 97
         $data->setShowDetail(false);
98 98
         $data->setShowIndex(false);
@@ -109,8 +109,8 @@  discard block
 block discarded – undo
109 109
         $data = new ImageModel();
110 110
         $data = $this->setDefaultModelValue($data);
111 111
         $data->setLabel($label);
112
-        $data->setName($this->name($label,$name));
113
-        $data->setField($field_to_save?:$this->name($label, $name));
112
+        $data->setName($this->name($label, $name));
113
+        $data->setField($field_to_save ?: $this->name($label, $name));
114 114
         $data->setType("image");
115 115
 
116 116
         columnSingleton()->setColumn($this->index, $data);
@@ -125,8 +125,8 @@  discard block
 block discarded – undo
125 125
         $data = new TextAreaModel();
126 126
         $data = $this->setDefaultModelValue($data);
127 127
         $data->setLabel($label);
128
-        $data->setName($this->name($label,$name));
129
-        $data->setField($field_to_save?:$this->name($label, $name));
128
+        $data->setName($this->name($label, $name));
129
+        $data->setField($field_to_save ?: $this->name($label, $name));
130 130
         $data->setType("text_area");
131 131
 
132 132
         columnSingleton()->setColumn($this->index, $data);
@@ -141,7 +141,7 @@  discard block
 block discarded – undo
141 141
         $data = new SelectTableModel();
142 142
         $data = $this->setDefaultModelValue($data);
143 143
         $data->setLabel($label);
144
-        $data->setName($this->name($label,$name));
144
+        $data->setName($this->name($label, $name));
145 145
         $data->setField($this->name($label, $name));
146 146
         $data->setType("select_table");
147 147
 
@@ -149,8 +149,8 @@  discard block
 block discarded – undo
149 149
 
150 150
         $selectTable = new SelectTable($this->index);
151 151
 
152
-        if($selectConfig) {
153
-            $selectTable->optionsFromTable($selectConfig['table'],$selectConfig['value_option'],$selectConfig['display_option'],@$selectConfig['sql_condition']);
152
+        if ($selectConfig) {
153
+            $selectTable->optionsFromTable($selectConfig['table'], $selectConfig['value_option'], $selectConfig['display_option'], @$selectConfig['sql_condition']);
154 154
         }
155 155
 
156 156
         return $selectTable;
@@ -163,7 +163,7 @@  discard block
 block discarded – undo
163 163
         $data = new SelectOptionModel();
164 164
         $data = $this->setDefaultModelValue($data);
165 165
         $data->setLabel($label);
166
-        $data->setName($this->name($label,$name));
166
+        $data->setName($this->name($label, $name));
167 167
         $data->setField($this->name($label, $name));
168 168
         $data->setType("select_option");
169 169
 
@@ -171,7 +171,7 @@  discard block
 block discarded – undo
171 171
 
172 172
         $selectOption = new SelectOption($this->index);
173 173
 
174
-        if($options) {
174
+        if ($options) {
175 175
             $selectOption->options($options);
176 176
         }
177 177
 
@@ -191,15 +191,15 @@  discard block
 block discarded – undo
191 191
         $data = new SelectQueryModel();
192 192
         $data = $this->setDefaultModelValue($data);
193 193
         $data->setLabel($label);
194
-        $data->setName($this->name($label,$name));
194
+        $data->setName($this->name($label, $name));
195 195
         $data->setField($this->name($label, $name));
196 196
         $data->setType("select_query");
197 197
 
198 198
         columnSingleton()->setColumn($this->index, $data);
199 199
 
200
-        $selectQuery =new SelectQuery($this->index);
200
+        $selectQuery = new SelectQuery($this->index);
201 201
 
202
-        if($query) {
202
+        if ($query) {
203 203
             $selectQuery->optionsFromQuery($query);
204 204
         }
205 205
 
@@ -214,8 +214,8 @@  discard block
 block discarded – undo
214 214
         $data = new CustomModel();
215 215
         $data = $this->setDefaultModelValue($data);
216 216
         $data->setLabel($label);
217
-        $data->setName($this->name($label,$name));
218
-        $data->setField($field_to_save?:$this->name($label, $name));
217
+        $data->setName($this->name($label, $name));
218
+        $data->setField($field_to_save ?: $this->name($label, $name));
219 219
         $data->setType("custom");
220 220
 
221 221
         columnSingleton()->setColumn($this->index, $data);
@@ -230,8 +230,8 @@  discard block
 block discarded – undo
230 230
         $data = new DateModel();
231 231
         $data = $this->setDefaultModelValue($data);
232 232
         $data->setLabel($label);
233
-        $data->setName($this->name($label,$name));
234
-        $data->setField($field_to_save?:$this->name($label, $name));
233
+        $data->setName($this->name($label, $name));
234
+        $data->setField($field_to_save ?: $this->name($label, $name));
235 235
         $data->setType("date");
236 236
 
237 237
         columnSingleton()->setColumn($this->index, $data);
@@ -246,8 +246,8 @@  discard block
 block discarded – undo
246 246
         $data = new DatetimeModel();
247 247
         $data = $this->setDefaultModelValue($data);
248 248
         $data->setLabel($label);
249
-        $data->setName($this->name($label,$name));
250
-        $data->setField($field_to_save?:$this->name($label, $name));
249
+        $data->setName($this->name($label, $name));
250
+        $data->setField($field_to_save ?: $this->name($label, $name));
251 251
         $data->setType("datetime");
252 252
 
253 253
         columnSingleton()->setColumn($this->index, $data);
@@ -262,8 +262,8 @@  discard block
 block discarded – undo
262 262
         $data = new EmailModel();
263 263
         $data = $this->setDefaultModelValue($data);
264 264
         $data->setLabel($label);
265
-        $data->setName($this->name($label,$name));
266
-        $data->setField($field_to_save?:$this->name($label, $name));
265
+        $data->setName($this->name($label, $name));
266
+        $data->setField($field_to_save ?: $this->name($label, $name));
267 267
         $data->setType("email");
268 268
 
269 269
         columnSingleton()->setColumn($this->index, $data);
@@ -278,8 +278,8 @@  discard block
 block discarded – undo
278 278
         $data = new FileModel();
279 279
         $data = $this->setDefaultModelValue($data);
280 280
         $data->setLabel($label);
281
-        $data->setName($this->name($label,$name));
282
-        $data->setField($field_to_save?:$this->name($label, $name));
281
+        $data->setName($this->name($label, $name));
282
+        $data->setField($field_to_save ?: $this->name($label, $name));
283 283
         $data->setType("file");
284 284
 
285 285
         columnSingleton()->setColumn($this->index, $data);
@@ -295,8 +295,8 @@  discard block
 block discarded – undo
295 295
         $data = new HiddenModel();
296 296
         $data = $this->setDefaultModelValue($data);
297 297
         $data->setLabel($label);
298
-        $data->setName($this->name($label,$name));
299
-        $data->setField($field_to_save?:$this->name($label, $name));
298
+        $data->setName($this->name($label, $name));
299
+        $data->setField($field_to_save ?: $this->name($label, $name));
300 300
         $data->setType("hidden");
301 301
 
302 302
         columnSingleton()->setColumn($this->index, $data);
@@ -311,8 +311,8 @@  discard block
 block discarded – undo
311 311
         $data = new NumberModel();
312 312
         $data = $this->setDefaultModelValue($data);
313 313
         $data->setLabel($label);
314
-        $data->setName($this->name($label,$name));
315
-        $data->setField($field_to_save?:$this->name($label, $name));
314
+        $data->setName($this->name($label, $name));
315
+        $data->setField($field_to_save ?: $this->name($label, $name));
316 316
         $data->setType("number");
317 317
 
318 318
         columnSingleton()->setColumn($this->index, $data);
@@ -327,8 +327,8 @@  discard block
 block discarded – undo
327 327
         $data = new MoneyModel();
328 328
         $data = $this->setDefaultModelValue($data);
329 329
         $data->setLabel($label);
330
-        $data->setName($this->name($label,$name));
331
-        $data->setField($field_to_save?:$this->name($label, $name));
330
+        $data->setName($this->name($label, $name));
331
+        $data->setField($field_to_save ?: $this->name($label, $name));
332 332
         $data->setType("money");
333 333
 
334 334
         columnSingleton()->setColumn($this->index, $data);
@@ -343,8 +343,8 @@  discard block
 block discarded – undo
343 343
         $data = new RadioModel();
344 344
         $data = $this->setDefaultModelValue($data);
345 345
         $data->setLabel($label);
346
-        $data->setName($this->name($label,$name));
347
-        $data->setField($field_to_save?:$this->name($label, $name));
346
+        $data->setName($this->name($label, $name));
347
+        $data->setField($field_to_save ?: $this->name($label, $name));
348 348
         $data->setType("radio");
349 349
 
350 350
         columnSingleton()->setColumn($this->index, $data);
@@ -359,8 +359,8 @@  discard block
 block discarded – undo
359 359
         $data = new WysiwygModel();
360 360
         $data = $this->setDefaultModelValue($data);
361 361
         $data->setLabel($label);
362
-        $data->setName($this->name($label,$name));
363
-        $data->setField($field_to_save?:$this->name($label, $name));
362
+        $data->setName($this->name($label, $name));
363
+        $data->setField($field_to_save ?: $this->name($label, $name));
364 364
         $data->setType("wysiwyg");
365 365
 
366 366
         columnSingleton()->setColumn($this->index, $data);
Please login to merge, or discard this patch.
src/commands/DeveloperCommandService.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -23,16 +23,16 @@
 block discarded – undo
23 23
 
24 24
     public function create()
25 25
     {
26
-        if($this->command->)
27
-        if($this->command->option("password") == "AUTO") {
26
+        if ($this->command->)
27
+        if ($this->command->option("password") == "AUTO") {
28 28
             $password = Str::random(16);
29
-        }else{
29
+        } else {
30 30
             $password = $this->command->option("password");
31 31
         }
32 32
 
33
-        if($this->command->option("username") == "AUTO") {
33
+        if ($this->command->option("username") == "AUTO") {
34 34
             $username = Str::random(5);
35
-        }else{
35
+        } else {
36 36
             $username = $this->command->option("username");
37 37
         }
38 38
 
Please login to merge, or discard this patch.
src/types/select_option/SelectOption.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -21,10 +21,10 @@
 block discarded – undo
21 21
     public function options($data_options) {
22 22
         $data = columnSingleton()->getColumn($this->index);
23 23
 
24
-        foreach($data_options as $key=>$option) {
25
-            if(is_int($key)) {
24
+        foreach ($data_options as $key=>$option) {
25
+            if (is_int($key)) {
26 26
                 $data_options[$option] = $option;
27
-            }else{
27
+            } else {
28 28
                 $data_options[$key] = $option;
29 29
             }
30 30
         }
Please login to merge, or discard this patch.