Passed
Push — master ( db1581...a5af1f )
by Ferry
04:30
created
src/controllers/DeveloperDashboardController.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -15,7 +15,7 @@
 block discarded – undo
15 15
     public function getIndex() {
16 16
         $data = [];
17 17
         $data['page_title'] = "Dashboard";
18
-        return view('crudbooster::dev_layouts.modules.dashboard',$data);
18
+        return view('crudbooster::dev_layouts.modules.dashboard', $data);
19 19
     }
20 20
     
21 21
 
Please login to merge, or discard this patch.
src/controllers/CBController.php 2 patches
Spacing   +49 added lines, -49 removed lines patch added patch discarded remove patch
@@ -27,14 +27,14 @@  discard block
 block discarded – undo
27 27
 
28 28
     public function __call($method, $parameters)
29 29
     {
30
-        if($method == "getData") {
30
+        if ($method == "getData") {
31 31
             $key = $parameters[0];
32
-            if(isset($this->data[$key])) {
32
+            if (isset($this->data[$key])) {
33 33
                 return $this->data[$key];
34
-            }else{
34
+            } else {
35 35
                 return null;
36 36
             }
37
-        }else{
37
+        } else {
38 38
             return null;
39 39
         }
40 40
     }
@@ -49,19 +49,19 @@  discard block
 block discarded – undo
49 49
 
50 50
         $query->addSelect($this->data['table'].'.'.cb()->pk($this->data['table']).' as primary_key');
51 51
 
52
-        if(isset($this->data['hook_query_index']) && is_callable($this->data['hook_query_index']))
52
+        if (isset($this->data['hook_query_index']) && is_callable($this->data['hook_query_index']))
53 53
         {
54 54
             $query = call_user_func($this->data['hook_query_index'], $query);
55 55
         }
56 56
 
57
-        $softDelete = isset($this->data['disable_soft_delete'])?$this->data['disable_soft_delete']:true;
58
-        if($softDelete === true && Schema::hasColumn($this->data['table'],'deleted_at')) {
57
+        $softDelete = isset($this->data['disable_soft_delete']) ? $this->data['disable_soft_delete'] : true;
58
+        if ($softDelete === true && Schema::hasColumn($this->data['table'], 'deleted_at')) {
59 59
             $query->whereNull($this->data['table'].'.deleted_at');
60 60
         }
61 61
 
62 62
 
63
-        if(isset($joins)) {
64
-            foreach($joins as $join)
63
+        if (isset($joins)) {
64
+            foreach ($joins as $join)
65 65
             {
66 66
                 $query->join($join['target_table'],
67 67
                         $join['target_table_primary'],
@@ -71,27 +71,27 @@  discard block
 block discarded – undo
71 71
             }
72 72
         }
73 73
 
74
-        foreach($columns as $column) {
74
+        foreach ($columns as $column) {
75 75
             /** @var ColumnModel $column */
76
-            if(strpos($column->getField(),".") === false) {
76
+            if (strpos($column->getField(), ".") === false) {
77 77
                 $query->addSelect($this->data['table'].'.'.$column->getField());
78
-            }else{
78
+            } else {
79 79
                 $query->addSelect($column->getField());
80 80
             }
81 81
 
82 82
             $query = getTypeHook($column->getType())->query($query, $column);
83 83
         }
84 84
 
85
-        if(request()->has('q'))
85
+        if (request()->has('q'))
86 86
         {
87
-            if(isset($this->data['hook_search_query'])) {
87
+            if (isset($this->data['hook_search_query'])) {
88 88
                 $query = call_user_func($this->data['hook_search_query'], $query);
89
-            }else{
90
-                $query->where(function ($where) use ($columns) {
89
+            } else {
90
+                $query->where(function($where) use ($columns) {
91 91
                     /**
92 92
                      * @var $where Builder
93 93
                      */
94
-                    foreach($columns as $column)
94
+                    foreach ($columns as $column)
95 95
                     {
96 96
                         $where->orWhere($column['name'], 'like', '%'.request('q').'%');
97 97
                     }
@@ -99,18 +99,18 @@  discard block
 block discarded – undo
99 99
             }
100 100
         }
101 101
 
102
-        if(isset($this->data['hook_query_index']) && is_callable($this->data['hook_query_index'])) {
102
+        if (isset($this->data['hook_query_index']) && is_callable($this->data['hook_query_index'])) {
103 103
             $query = call_user_func($this->data['hook_query_index'], $query);
104 104
         }
105 105
 
106 106
 
107
-        if(request()->has(['order_by','order_sort']))
107
+        if (request()->has(['order_by', 'order_sort']))
108 108
         {
109
-            if(in_array(request('order_by'),columnSingleton()->getColumnNameOnly())) {
109
+            if (in_array(request('order_by'), columnSingleton()->getColumnNameOnly())) {
110 110
                 $query->orderBy(request('order_by'), request('order_sort'));
111 111
             }
112
-        }else{
113
-            if(isset($this->data['order_by'])) {
112
+        } else {
113
+            if (isset($this->data['order_by'])) {
114 114
                 $query->orderBy($this->data['order_by'][0], $this->data['order_by'][1]);
115 115
             }
116 116
         }
@@ -120,7 +120,7 @@  discard block
 block discarded – undo
120 120
 
121 121
     public function getIndex()
122 122
     {
123
-        if(!module()->canBrowse()) return cb()->redirect(cb()->getAdminUrl(),"You do not have access to this area");
123
+        if (!module()->canBrowse()) return cb()->redirect(cb()->getAdminUrl(), "You do not have access to this area");
124 124
 
125 125
         $query = $this->repository();
126 126
         $result = $query->paginate(20);
@@ -134,51 +134,51 @@  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 access to this area");
149
+        if (!module()->canCreate()) return cb()->redirect(cb()->getAdminUrl(), "You do not have 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',$data);
154
+        return view('crudbooster::module.form.form', $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 access to this area");
159
+        if (!module()->canCreate()) return cb()->redirect(cb()->getAdminUrl(), "You do not have access to this area");
160 160
 
161 161
         try {
162 162
             $this->validation();
163 163
             columnSingleton()->valueAssignment();
164 164
             $data = columnSingleton()->getAssignmentData();
165 165
 
166
-            if(Schema::hasColumn($this->data['table'], 'created_at')) {
166
+            if (Schema::hasColumn($this->data['table'], 'created_at')) {
167 167
                 $data['created_at'] = date('Y-m-d H:i:s');
168 168
             }
169 169
 
170 170
             $id = DB::table($this->data['table'])->insertGetId($data);
171 171
 
172
-            if(isset($this->data['hook_after_insert']) && is_callable($this->data['hook_after_insert'])) {
172
+            if (isset($this->data['hook_after_insert']) && is_callable($this->data['hook_after_insert'])) {
173 173
                 call_user_func($this->data['hook_after_insert'], $id);
174 174
             }
175 175
 
176 176
         } catch (CBValidationException $e) {
177 177
             Log::debug($e);
178
-            return cb()->redirectBack($e->getMessage(),'info');
178
+            return cb()->redirectBack($e->getMessage(), 'info');
179 179
         } catch (\Exception $e) {
180 180
             Log::error($e);
181
-            return cb()->redirectBack($e->getMessage(),'warning');
181
+            return cb()->redirectBack($e->getMessage(), 'warning');
182 182
         }
183 183
 
184 184
         if (request('submit') == trans('crudbooster.button_save_more')) {
@@ -190,7 +190,7 @@  discard block
 block discarded – undo
190 190
 
191 191
     public function getEdit($id)
192 192
     {
193
-        if(!module()->canUpdate()) return cb()->redirect(cb()->getAdminUrl(),"You do not have access to this area");
193
+        if (!module()->canUpdate()) return cb()->redirect(cb()->getAdminUrl(), "You do not have access to this area");
194 194
 
195 195
         $data = [];
196 196
         $data['row'] = $this->repository()->where($this->data['table'].'.'.getPrimaryKey($this->data['table']), $id)->first();
@@ -201,17 +201,17 @@  discard block
 block discarded – undo
201 201
 
202 202
     public function postEditSave($id)
203 203
     {
204
-        if(!module()->canUpdate()) return cb()->redirect(cb()->getAdminUrl(),"You do not have access to this area");
204
+        if (!module()->canUpdate()) return cb()->redirect(cb()->getAdminUrl(), "You do not have access to this area");
205 205
 
206 206
         try {
207 207
             $this->validation();
208 208
             columnSingleton()->valueAssignment();
209 209
             $data = columnSingleton()->getAssignmentData();
210
-            if(Schema::hasColumn($this->data['table'], 'updated_at')) {
210
+            if (Schema::hasColumn($this->data['table'], 'updated_at')) {
211 211
                 $data['updated_at'] = date('Y-m-d H:i:s');
212 212
             }
213 213
 
214
-            if(isset($this->data['hook_before_update']) && is_callable($this->data['hook_before_update'])) {
214
+            if (isset($this->data['hook_before_update']) && is_callable($this->data['hook_before_update'])) {
215 215
                 call_user_func($this->data['hook_before_update'], $id);
216 216
             }
217 217
 
@@ -219,16 +219,16 @@  discard block
 block discarded – undo
219 219
                 ->where(cb()->pk($this->data['table']), $id)
220 220
                 ->update($data);
221 221
 
222
-            if(isset($this->data['hook_after_update']) && is_callable($this->data['hook_after_update'])) {
222
+            if (isset($this->data['hook_after_update']) && is_callable($this->data['hook_after_update'])) {
223 223
                 call_user_func($this->data['hook_after_update'], $id);
224 224
             }
225 225
 
226 226
         } catch (CBValidationException $e) {
227 227
             Log::debug($e);
228
-            return cb()->redirectBack($e->getMessage(),'info');
228
+            return cb()->redirectBack($e->getMessage(), 'info');
229 229
         } catch (\Exception $e) {
230 230
             Log::error($e);
231
-            return cb()->redirectBack($e->getMessage(),'warning');
231
+            return cb()->redirectBack($e->getMessage(), 'warning');
232 232
         }
233 233
 
234 234
 
@@ -241,15 +241,15 @@  discard block
 block discarded – undo
241 241
 
242 242
     public function getDelete($id)
243 243
     {
244
-        if(!module()->canDelete()) return cb()->redirect(cb()->getAdminUrl(),"You do not have access to this area");
244
+        if (!module()->canDelete()) return cb()->redirect(cb()->getAdminUrl(), "You do not have access to this area");
245 245
 
246
-        if(isset($this->data['hook_before_delete']) && is_callable($this->data['hook_before_delete'])) {
246
+        if (isset($this->data['hook_before_delete']) && is_callable($this->data['hook_before_delete'])) {
247 247
             call_user_func($this->data['hook_before_delete'], $id);
248 248
         }
249 249
 
250
-        $softDelete = isset($this->data['disable_soft_delete'])?$this->data['disable_soft_delete']:true;
250
+        $softDelete = isset($this->data['disable_soft_delete']) ? $this->data['disable_soft_delete'] : true;
251 251
 
252
-        if ($softDelete === true && Schema::hasColumn($this->data['table'],'deleted_at')) {
252
+        if ($softDelete === true && Schema::hasColumn($this->data['table'], 'deleted_at')) {
253 253
             DB::table($this->data['table'])
254 254
                 ->where(getPrimaryKey($this->data['table']), $id)
255 255
                 ->update(['deleted_at' => date('Y-m-d H:i:s')]);
@@ -259,7 +259,7 @@  discard block
 block discarded – undo
259 259
                 ->delete();
260 260
         }
261 261
 
262
-        if(isset($this->data['hook_after_delete']) && is_callable($this->data['hook_after_delete'])) {
262
+        if (isset($this->data['hook_after_delete']) && is_callable($this->data['hook_after_delete'])) {
263 263
             call_user_func($this->data['hook_after_delete'], $id);
264 264
         }
265 265
 
@@ -268,7 +268,7 @@  discard block
 block discarded – undo
268 268
 
269 269
     public function getDetail($id)
270 270
     {
271
-        if(!module()->canRead()) return cb()->redirect(cb()->getAdminUrl(),"You do not have access to this area");
271
+        if (!module()->canRead()) return cb()->redirect(cb()->getAdminUrl(), "You do not have access to this area");
272 272
 
273 273
         $data = [];
274 274
         $data['row'] = $this->repository()->where($this->data['table'].'.'.getPrimaryKey($this->data['table']), $id)->first();
@@ -278,21 +278,21 @@  discard block
 block discarded – undo
278 278
 
279 279
     public function postUploadFile()
280 280
     {
281
-        if(auth()->guest()) return redirect(cb()->getLoginUrl());
281
+        if (auth()->guest()) return redirect(cb()->getLoginUrl());
282 282
 
283 283
         $file = null;
284 284
         try {
285 285
 
286 286
             cb()->validation([
287
-                'userfile' => 'required|mimes:' . config('crudbooster.UPLOAD_TYPES')
287
+                'userfile' => 'required|mimes:'.config('crudbooster.UPLOAD_TYPES')
288 288
             ]);
289 289
 
290 290
             $file = cb()->uploadFile('userfile', true);
291 291
 
292 292
         } catch (CBValidationException $e) {
293
-            return response()->json(['status'=>false,'message'=>$e->getMessage()]);
293
+            return response()->json(['status'=>false, 'message'=>$e->getMessage()]);
294 294
         } catch (\Exception $e) {
295
-            return response()->json(['status'=>false,'message'=>$e->getMessage()]);
295
+            return response()->json(['status'=>false, 'message'=>$e->getMessage()]);
296 296
         }
297 297
 
298 298
         return response()->json([
Please login to merge, or discard this patch.
Braces   +29 added lines, -13 removed lines patch added patch discarded remove patch
@@ -31,10 +31,10 @@  discard block
 block discarded – undo
31 31
             $key = $parameters[0];
32 32
             if(isset($this->data[$key])) {
33 33
                 return $this->data[$key];
34
-            }else{
34
+            } else{
35 35
                 return null;
36 36
             }
37
-        }else{
37
+        } else{
38 38
             return null;
39 39
         }
40 40
     }
@@ -75,7 +75,7 @@  discard block
 block discarded – undo
75 75
             /** @var ColumnModel $column */
76 76
             if(strpos($column->getField(),".") === false) {
77 77
                 $query->addSelect($this->data['table'].'.'.$column->getField());
78
-            }else{
78
+            } else{
79 79
                 $query->addSelect($column->getField());
80 80
             }
81 81
 
@@ -86,7 +86,7 @@  discard block
 block discarded – undo
86 86
         {
87 87
             if(isset($this->data['hook_search_query'])) {
88 88
                 $query = call_user_func($this->data['hook_search_query'], $query);
89
-            }else{
89
+            } else{
90 90
                 $query->where(function ($where) use ($columns) {
91 91
                     /**
92 92
                      * @var $where Builder
@@ -109,7 +109,7 @@  discard block
 block discarded – undo
109 109
             if(in_array(request('order_by'),columnSingleton()->getColumnNameOnly())) {
110 110
                 $query->orderBy(request('order_by'), request('order_sort'));
111 111
             }
112
-        }else{
112
+        } else{
113 113
             if(isset($this->data['order_by'])) {
114 114
                 $query->orderBy($this->data['order_by'][0], $this->data['order_by'][1]);
115 115
             }
@@ -120,7 +120,9 @@  discard block
 block discarded – undo
120 120
 
121 121
     public function getIndex()
122 122
     {
123
-        if(!module()->canBrowse()) return cb()->redirect(cb()->getAdminUrl(),"You do not have access to this area");
123
+        if(!module()->canBrowse()) {
124
+            return cb()->redirect(cb()->getAdminUrl(),"You do not have access to this area");
125
+        }
124 126
 
125 127
         $query = $this->repository();
126 128
         $result = $query->paginate(20);
@@ -146,7 +148,9 @@  discard block
 block discarded – undo
146 148
 
147 149
     public function getAdd()
148 150
     {
149
-        if(!module()->canCreate()) return cb()->redirect(cb()->getAdminUrl(),"You do not have access to this area");
151
+        if(!module()->canCreate()) {
152
+            return cb()->redirect(cb()->getAdminUrl(),"You do not have access to this area");
153
+        }
150 154
 
151 155
         $data = [];
152 156
         $data['page_title'] = $this->data['page_title'].' : Add';
@@ -156,7 +160,9 @@  discard block
 block discarded – undo
156 160
 
157 161
     public function postAddSave()
158 162
     {
159
-        if(!module()->canCreate()) return cb()->redirect(cb()->getAdminUrl(),"You do not have access to this area");
163
+        if(!module()->canCreate()) {
164
+            return cb()->redirect(cb()->getAdminUrl(),"You do not have access to this area");
165
+        }
160 166
 
161 167
         try {
162 168
             $this->validation();
@@ -190,7 +196,9 @@  discard block
 block discarded – undo
190 196
 
191 197
     public function getEdit($id)
192 198
     {
193
-        if(!module()->canUpdate()) return cb()->redirect(cb()->getAdminUrl(),"You do not have access to this area");
199
+        if(!module()->canUpdate()) {
200
+            return cb()->redirect(cb()->getAdminUrl(),"You do not have access to this area");
201
+        }
194 202
 
195 203
         $data = [];
196 204
         $data['row'] = $this->repository()->where($this->data['table'].'.'.getPrimaryKey($this->data['table']), $id)->first();
@@ -201,7 +209,9 @@  discard block
 block discarded – undo
201 209
 
202 210
     public function postEditSave($id)
203 211
     {
204
-        if(!module()->canUpdate()) return cb()->redirect(cb()->getAdminUrl(),"You do not have access to this area");
212
+        if(!module()->canUpdate()) {
213
+            return cb()->redirect(cb()->getAdminUrl(),"You do not have access to this area");
214
+        }
205 215
 
206 216
         try {
207 217
             $this->validation();
@@ -241,7 +251,9 @@  discard block
 block discarded – undo
241 251
 
242 252
     public function getDelete($id)
243 253
     {
244
-        if(!module()->canDelete()) return cb()->redirect(cb()->getAdminUrl(),"You do not have access to this area");
254
+        if(!module()->canDelete()) {
255
+            return cb()->redirect(cb()->getAdminUrl(),"You do not have access to this area");
256
+        }
245 257
 
246 258
         if(isset($this->data['hook_before_delete']) && is_callable($this->data['hook_before_delete'])) {
247 259
             call_user_func($this->data['hook_before_delete'], $id);
@@ -268,7 +280,9 @@  discard block
 block discarded – undo
268 280
 
269 281
     public function getDetail($id)
270 282
     {
271
-        if(!module()->canRead()) return cb()->redirect(cb()->getAdminUrl(),"You do not have access to this area");
283
+        if(!module()->canRead()) {
284
+            return cb()->redirect(cb()->getAdminUrl(),"You do not have access to this area");
285
+        }
272 286
 
273 287
         $data = [];
274 288
         $data['row'] = $this->repository()->where($this->data['table'].'.'.getPrimaryKey($this->data['table']), $id)->first();
@@ -278,7 +292,9 @@  discard block
 block discarded – undo
278 292
 
279 293
     public function postUploadFile()
280 294
     {
281
-        if(auth()->guest()) return redirect(cb()->getLoginUrl());
295
+        if(auth()->guest()) {
296
+            return redirect(cb()->getLoginUrl());
297
+        }
282 298
 
283 299
         $file = null;
284 300
         try {
Please login to merge, or discard this patch.
src/controllers/DeveloperModulesController.php 1 patch
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -26,7 +26,7 @@  discard block
 block discarded – undo
26 26
     public function getIndex() {
27 27
         $data = [];
28 28
         $data['result'] = DB::table("cb_modules")->get();
29
-        return view($this->view.'.index',$data);
29
+        return view($this->view.'.index', $data);
30 30
     }
31 31
 
32 32
     public function getAdd() {
@@ -37,11 +37,11 @@  discard block
 block discarded – undo
37 37
 
38 38
     public function postAddSave() {
39 39
         try {
40
-            cb()->validation(['name', 'table','icon']);
40
+            cb()->validation(['name', 'table', 'icon']);
41 41
 
42 42
             (new ModuleGenerator(request('table'), request('name'), request('icon')))->make();
43 43
 
44
-            return cb()->redirect(route("DeveloperModulesControllerGetIndex"),"New module has been created!","success");
44
+            return cb()->redirect(route("DeveloperModulesControllerGetIndex"), "New module has been created!", "success");
45 45
 
46 46
         } catch (CBValidationException $e) {
47 47
             return cb()->redirectBack($e->getMessage());
@@ -58,9 +58,9 @@  discard block
 block discarded – undo
58 58
         try {
59 59
             cb()->validation(['name', 'icon']);
60 60
 
61
-            cb()->updateCompact("cb_modules", $id, ['name','icon']);
61
+            cb()->updateCompact("cb_modules", $id, ['name', 'icon']);
62 62
 
63
-            return cb()->redirect(route("DeveloperModulesControllerGetIndex"),"Module has been updated!","success");
63
+            return cb()->redirect(route("DeveloperModulesControllerGetIndex"), "Module has been updated!", "success");
64 64
 
65 65
         } catch (CBValidationException $e) {
66 66
             return cb()->redirectBack($e->getMessage());
@@ -68,12 +68,12 @@  discard block
 block discarded – undo
68 68
     }
69 69
 
70 70
     public function getDelete($id) {
71
-        $module = cb()->find("cb_modules",$id);
71
+        $module = cb()->find("cb_modules", $id);
72 72
         @unlink(app_path("Http/Controllers/".$module->controller));
73 73
         DB::table("cb_modules")->where("id", $id)->delete();
74 74
         DB::table("cb_menus")->where("cb_modules_id", $id)->delete();
75 75
 
76
-        return cb()->redirectBack("The module has been deleted!","success");
76
+        return cb()->redirectBack("The module has been deleted!", "success");
77 77
     }
78 78
 
79 79
 }
80 80
\ No newline at end of file
Please login to merge, or discard this patch.
src/controllers/AdminAuthController.php 2 patches
Spacing   +11 added lines, -11 removed lines patch added patch discarded remove patch
@@ -7,7 +7,7 @@  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()) return redirect(cb()->getAdminUrl());
11 11
 
12 12
         cbHook()->hookGetLogin();
13 13
 
@@ -16,20 +16,20 @@  discard block
 block discarded – undo
16 16
 
17 17
     public function postLogin()
18 18
     {
19
-        try{
19
+        try {
20 20
             cb()->validation([
21 21
                 'email'=>'required|email',
22 22
                 'password'=>'required'
23 23
             ]);
24
-            $credential = request()->only(['email','password']);
24
+            $credential = request()->only(['email', 'password']);
25 25
             if (auth()->attempt($credential)) {
26 26
                 cbHook()->hookPostLogin();
27 27
                 return redirect(cb()->getAdminUrl());
28 28
             } else {
29
-                return redirect(cb()->getLoginUrl())->with(['message'=>__('crudbooster.alert_password_wrong'),'message_type'=>'warning']);
29
+                return redirect(cb()->getLoginUrl())->with(['message'=>__('crudbooster.alert_password_wrong'), 'message_type'=>'warning']);
30 30
             }
31
-        }catch (CBValidationException $e) {
32
-            return cb()->redirect(cb()->getAdminUrl("login"),$e->getMessage(),'warning');
31
+        } catch (CBValidationException $e) {
32
+            return cb()->redirect(cb()->getAdminUrl("login"), $e->getMessage(), 'warning');
33 33
         }
34 34
     }
35 35
 
@@ -44,25 +44,25 @@  discard block
 block discarded – undo
44 44
     }
45 45
 
46 46
     public function postLoginDeveloper() {
47
-        try{
47
+        try {
48 48
             cb()->validation([
49 49
                 'username'=>'required',
50 50
                 'password'=>'required'
51 51
             ]);
52 52
 
53
-            if(request('username') == config('crudbooster.DEV_USERNAME')
53
+            if (request('username') == config('crudbooster.DEV_USERNAME')
54 54
                 && request('password') == config('crudbooster.DEV_PASSWORD')) {
55 55
 
56 56
                 session(['developer'=>1]);
57 57
 
58 58
                 return redirect(cb()->getDeveloperUrl());
59 59
 
60
-            }else{
60
+            } else {
61 61
                 return cb()->redirectBack("Username and or password is wrong!");
62 62
             }
63 63
 
64
-        }catch (CBValidationException $e) {
65
-            return cb()->redirect(cb()->getLoginUrl(),$e->getMessage(),'warning');
64
+        } catch (CBValidationException $e) {
65
+            return cb()->redirect(cb()->getLoginUrl(), $e->getMessage(), 'warning');
66 66
         }
67 67
     }
68 68
 
Please login to merge, or discard this 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.
src/helpers/Module.php 2 patches
Spacing   +46 added lines, -46 removed lines patch added patch discarded remove patch
@@ -25,14 +25,14 @@  discard block
 block discarded – undo
25 25
     {
26 26
         $routeArray = request()->route()->getAction();
27 27
         $this->controller = class_basename($routeArray['controller']);
28
-        $this->controller = strtok($this->controller,"@");
28
+        $this->controller = strtok($this->controller, "@");
29 29
 
30 30
         $className = "\\".$routeArray["namespace"]."\\".$this->controller;
31
-        if(class_exists($className)) {
31
+        if (class_exists($className)) {
32 32
             $this->controller_class = new $className();
33
-            $this->module = cb()->find("cb_modules",["controller"=>$this->controller]);
34
-            $this->menu = cb()->find("cb_menus",["cb_modules_id"=>$this->module->id]);
35
-            $this->menu = (!$this->menu)?cb()->find("cb_menus",["type"=>"path","path"=>request()->segment(2)]):$this->menu;
33
+            $this->module = cb()->find("cb_modules", ["controller"=>$this->controller]);
34
+            $this->menu = cb()->find("cb_menus", ["cb_modules_id"=>$this->module->id]);
35
+            $this->menu = (!$this->menu) ?cb()->find("cb_menus", ["type"=>"path", "path"=>request()->segment(2)]) : $this->menu;
36 36
             $this->privilege = DB::table("cb_role_privileges")
37 37
                 ->where("cb_menus_id", $this->menu->id)
38 38
                 ->where("cb_roles_id", cb()->session()->roleId())
@@ -49,135 +49,135 @@  discard block
 block discarded – undo
49 49
     }
50 50
 
51 51
     public function getData($key) {
52
-        return ($this->controller_class)?$this->controller_class->getData($key)?:cb()->getAppName():null;
52
+        return ($this->controller_class) ? $this->controller_class->getData($key) ?: cb()->getAppName() : null;
53 53
     }
54 54
 
55 55
     /**
56 56
      * @return CBController
57 57
      */
58 58
     public function getController() {
59
-        return ($this->controller_class)?$this->controller_class:null;
59
+        return ($this->controller_class) ? $this->controller_class : null;
60 60
     }
61 61
 
62 62
     public function getPageTitle()
63 63
     {
64
-        return ($this->controller_class)?$this->controller_class->getData("page_title")?:cb()->getAppName():null;
64
+        return ($this->controller_class) ? $this->controller_class->getData("page_title") ?: cb()->getAppName() : null;
65 65
     }
66 66
 
67 67
     public function getTable()
68 68
     {
69
-        return ($this->controller_class)?$this->controller_class->getData("table"):null;
69
+        return ($this->controller_class) ? $this->controller_class->getData("table") : null;
70 70
     }
71 71
 
72 72
     public function getPageIcon()
73 73
     {
74
-        return ($this->controller_class)?$this->controller_class->getData('page_icon')?:"fa fa-bars":null;
74
+        return ($this->controller_class) ? $this->controller_class->getData('page_icon') ?: "fa fa-bars" : null;
75 75
     }
76 76
 
77 77
     public function canBrowse() {
78
-        if($this->privilege) {
79
-            if($this->privilege->can_browse) return true;
78
+        if ($this->privilege) {
79
+            if ($this->privilege->can_browse) return true;
80 80
             else return false;
81
-        }else{
81
+        } else {
82 82
             return true;
83 83
         }
84 84
     }
85 85
 
86 86
     public function canCreate() {
87
-        if($this->privilege) {
88
-            if($this->privilege->can_create) return true;
87
+        if ($this->privilege) {
88
+            if ($this->privilege->can_create) return true;
89 89
             else return false;
90
-        }else{
90
+        } else {
91 91
             return true;
92 92
         }
93 93
     }
94 94
 
95 95
     public function canRead() {
96
-        if($this->privilege) {
97
-            if($this->privilege->can_read) return true;
96
+        if ($this->privilege) {
97
+            if ($this->privilege->can_read) return true;
98 98
             else return false;
99
-        }else{
99
+        } else {
100 100
             return true;
101 101
         }
102 102
     }
103 103
 
104 104
     public function canUpdate() {
105
-        if($this->privilege) {
106
-            if($this->privilege->can_update) return true;
105
+        if ($this->privilege) {
106
+            if ($this->privilege->can_update) return true;
107 107
             else return false;
108
-        }else{
108
+        } else {
109 109
             return true;
110 110
         }
111 111
     }
112 112
 
113 113
     public function canDelete() {
114
-        if($this->privilege) {
115
-            if($this->privilege->can_delete) return true;
114
+        if ($this->privilege) {
115
+            if ($this->privilege->can_delete) return true;
116 116
             else return false;
117
-        }else{
117
+        } else {
118 118
             return true;
119 119
         }
120 120
     }
121 121
 
122 122
     public function addURL()
123 123
     {
124
-        if($this->controller_class && method_exists($this->controller_class, 'getAdd')) {
124
+        if ($this->controller_class && method_exists($this->controller_class, 'getAdd')) {
125 125
             return action($this->controller.'@getAdd');
126
-        }else{
126
+        } else {
127 127
             return null;
128 128
         }
129 129
     }
130 130
 
131 131
     public function addSaveURL()
132 132
     {
133
-        if($this->controller_class && method_exists($this->controller_class, 'postAddSave')) {
133
+        if ($this->controller_class && method_exists($this->controller_class, 'postAddSave')) {
134 134
             return action($this->controller.'@postAddSave');
135
-        }else{
135
+        } else {
136 136
             return null;
137 137
         }
138 138
     }
139 139
 
140 140
     public function editURL($id = null)
141 141
     {
142
-        if($this->controller_class && method_exists($this->controller_class, 'getEdit')) {
143
-            return action($this->controller.'@getEdit',['id'=>$id]);
144
-        }else{
142
+        if ($this->controller_class && method_exists($this->controller_class, 'getEdit')) {
143
+            return action($this->controller.'@getEdit', ['id'=>$id]);
144
+        } else {
145 145
             return null;
146 146
         }
147 147
     }
148 148
 
149 149
     public function editSaveURL($id = null)
150 150
     {
151
-        if(method_exists($this->controller_class, 'postEditSave')) {
152
-            return action($this->controller.'@postEditSave',['id'=>$id]);
153
-        }else{
151
+        if (method_exists($this->controller_class, 'postEditSave')) {
152
+            return action($this->controller.'@postEditSave', ['id'=>$id]);
153
+        } else {
154 154
             return null;
155 155
         }
156 156
     }
157 157
 
158
-    public function detailURL($id=null)
158
+    public function detailURL($id = null)
159 159
     {
160
-        if($this->controller_class && method_exists($this->controller_class, 'getDetail')) {
161
-            return action($this->controller.'@getDetail',['id'=>$id]);
162
-        }else{
160
+        if ($this->controller_class && method_exists($this->controller_class, 'getDetail')) {
161
+            return action($this->controller.'@getDetail', ['id'=>$id]);
162
+        } else {
163 163
             return null;
164 164
         }
165 165
     }
166 166
 
167
-    public function deleteURL($id=null)
167
+    public function deleteURL($id = null)
168 168
     {
169
-        if($this->controller_class && method_exists($this->controller_class, 'getDelete')) {
170
-            return action($this->controller.'@getDelete',['id'=>$id]);
171
-        }else{
169
+        if ($this->controller_class && method_exists($this->controller_class, 'getDelete')) {
170
+            return action($this->controller.'@getDelete', ['id'=>$id]);
171
+        } else {
172 172
             return null;
173 173
         }
174 174
     }
175 175
 
176 176
     public function url($path = null)
177 177
     {
178
-        if($this->controller_class && method_exists($this->controller_class, 'getIndex')) {
179
-            return trim(action($this->controller.'@getIndex').'/'.$path,'/');
180
-        }else{
178
+        if ($this->controller_class && method_exists($this->controller_class, 'getIndex')) {
179
+            return trim(action($this->controller.'@getIndex').'/'.$path, '/');
180
+        } else {
181 181
             return null;
182 182
         }
183 183
     }
Please login to merge, or discard this patch.
Braces   +37 added lines, -22 removed lines patch added patch discarded remove patch
@@ -76,45 +76,60 @@  discard block
 block discarded – undo
76 76
 
77 77
     public function canBrowse() {
78 78
         if($this->privilege) {
79
-            if($this->privilege->can_browse) return true;
80
-            else return false;
81
-        }else{
79
+            if($this->privilege->can_browse) {
80
+                return true;
81
+            } else {
82
+                return false;
83
+            }
84
+        } else{
82 85
             return true;
83 86
         }
84 87
     }
85 88
 
86 89
     public function canCreate() {
87 90
         if($this->privilege) {
88
-            if($this->privilege->can_create) return true;
89
-            else return false;
90
-        }else{
91
+            if($this->privilege->can_create) {
92
+                return true;
93
+            } else {
94
+                return false;
95
+            }
96
+        } else{
91 97
             return true;
92 98
         }
93 99
     }
94 100
 
95 101
     public function canRead() {
96 102
         if($this->privilege) {
97
-            if($this->privilege->can_read) return true;
98
-            else return false;
99
-        }else{
103
+            if($this->privilege->can_read) {
104
+                return true;
105
+            } else {
106
+                return false;
107
+            }
108
+        } else{
100 109
             return true;
101 110
         }
102 111
     }
103 112
 
104 113
     public function canUpdate() {
105 114
         if($this->privilege) {
106
-            if($this->privilege->can_update) return true;
107
-            else return false;
108
-        }else{
115
+            if($this->privilege->can_update) {
116
+                return true;
117
+            } else {
118
+                return false;
119
+            }
120
+        } else{
109 121
             return true;
110 122
         }
111 123
     }
112 124
 
113 125
     public function canDelete() {
114 126
         if($this->privilege) {
115
-            if($this->privilege->can_delete) return true;
116
-            else return false;
117
-        }else{
127
+            if($this->privilege->can_delete) {
128
+                return true;
129
+            } else {
130
+                return false;
131
+            }
132
+        } else{
118 133
             return true;
119 134
         }
120 135
     }
@@ -123,7 +138,7 @@  discard block
 block discarded – undo
123 138
     {
124 139
         if($this->controller_class && method_exists($this->controller_class, 'getAdd')) {
125 140
             return action($this->controller.'@getAdd');
126
-        }else{
141
+        } else{
127 142
             return null;
128 143
         }
129 144
     }
@@ -132,7 +147,7 @@  discard block
 block discarded – undo
132 147
     {
133 148
         if($this->controller_class && method_exists($this->controller_class, 'postAddSave')) {
134 149
             return action($this->controller.'@postAddSave');
135
-        }else{
150
+        } else{
136 151
             return null;
137 152
         }
138 153
     }
@@ -141,7 +156,7 @@  discard block
 block discarded – undo
141 156
     {
142 157
         if($this->controller_class && method_exists($this->controller_class, 'getEdit')) {
143 158
             return action($this->controller.'@getEdit',['id'=>$id]);
144
-        }else{
159
+        } else{
145 160
             return null;
146 161
         }
147 162
     }
@@ -150,7 +165,7 @@  discard block
 block discarded – undo
150 165
     {
151 166
         if(method_exists($this->controller_class, 'postEditSave')) {
152 167
             return action($this->controller.'@postEditSave',['id'=>$id]);
153
-        }else{
168
+        } else{
154 169
             return null;
155 170
         }
156 171
     }
@@ -159,7 +174,7 @@  discard block
 block discarded – undo
159 174
     {
160 175
         if($this->controller_class && method_exists($this->controller_class, 'getDetail')) {
161 176
             return action($this->controller.'@getDetail',['id'=>$id]);
162
-        }else{
177
+        } else{
163 178
             return null;
164 179
         }
165 180
     }
@@ -168,7 +183,7 @@  discard block
 block discarded – undo
168 183
     {
169 184
         if($this->controller_class && method_exists($this->controller_class, 'getDelete')) {
170 185
             return action($this->controller.'@getDelete',['id'=>$id]);
171
-        }else{
186
+        } else{
172 187
             return null;
173 188
         }
174 189
     }
@@ -177,7 +192,7 @@  discard block
 block discarded – undo
177 192
     {
178 193
         if($this->controller_class && method_exists($this->controller_class, 'getIndex')) {
179 194
             return trim(action($this->controller.'@getIndex').'/'.$path,'/');
180
-        }else{
195
+        } else{
181 196
             return null;
182 197
         }
183 198
     }
Please login to merge, or discard this patch.
src/helpers/ModuleGenerator.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -43,7 +43,7 @@  discard block
 block discarded – undo
43 43
         $template = file_get_contents(__DIR__."/../templates/FooBarController.stub");
44 44
 
45 45
         //Replace table
46
-        $template = str_replace("{table}",'"'.$this->table.'"', $template);
46
+        $template = str_replace("{table}", '"'.$this->table.'"', $template);
47 47
 
48 48
         //Replace permalink
49 49
         $template = str_replace("{permalink}", '"'.$this->table.'"', $template);
@@ -51,7 +51,7 @@  discard block
 block discarded – undo
51 51
         //Replace scaffolding
52 52
         $fields = DB::getSchemaBuilder()->getColumnListing($this->table);
53 53
         $scaffold = "";
54
-        foreach($fields as $field) {
54
+        foreach ($fields as $field) {
55 55
             $scaffold .= '$this->addText("'.$field.'");'."\n\t\t";
56 56
         }
57 57
         $template = str_replace("{scaffolding}", $scaffold, $template);
@@ -66,7 +66,7 @@  discard block
 block discarded – undo
66 66
 
67 67
         //Save to database
68 68
         $module = [];
69
-        $module['name'] = ($this->name)?:ucwords(str_replace("_"," ",$this->table));
69
+        $module['name'] = ($this->name) ?: ucwords(str_replace("_", " ", $this->table));
70 70
         $module['icon'] = $this->icon;
71 71
         $module['table_name'] = $this->table;
72 72
         $module['controller'] = $filename;
Please login to merge, or discard this patch.
src/helpers/SidebarMenus.php 2 patches
Spacing   +16 added lines, -16 removed lines patch added patch discarded remove patch
@@ -22,7 +22,7 @@  discard block
 block discarded – undo
22 22
     private function assignToModel($menu) {
23 23
         $model = new SidebarModel();
24 24
         $model->setId($menu->id);
25
-        if($menu->type == "url") {
25
+        if ($menu->type == "url") {
26 26
             $model->setUrl($menu->path);
27 27
             $model->setIcon($menu->icon);
28 28
             $model->setName($menu->name);
@@ -47,22 +47,22 @@  discard block
 block discarded – undo
47 47
 
48 48
     private function loadData($parent_id = null) {
49 49
         $menus = DB::table("cb_menus");
50
-        if($parent_id) {
51
-            $menus->where("parent_cb_menus_id",$parent_id);
52
-        }else{
50
+        if ($parent_id) {
51
+            $menus->where("parent_cb_menus_id", $parent_id);
52
+        } else {
53 53
             $menus->whereNull("parent_cb_menus_id");
54 54
         }
55
-        return $menus->orderBy("sort_number","asc")->get();
55
+        return $menus->orderBy("sort_number", "asc")->get();
56 56
     }
57 57
 
58 58
     private function rolePrivilege($cb_roles_id, $cb_menus_id) {
59
-        return cb()->find("cb_role_privileges",['cb_roles_id'=>$cb_roles_id,'cb_menus_id'=>$cb_menus_id]);
59
+        return cb()->find("cb_role_privileges", ['cb_roles_id'=>$cb_roles_id, 'cb_menus_id'=>$cb_menus_id]);
60 60
     }
61 61
 
62
-    private function checkPrivilege($roles_id,$menu) {
63
-        if($roles_id) {
62
+    private function checkPrivilege($roles_id, $menu) {
63
+        if ($roles_id) {
64 64
             $privilege = $this->rolePrivilege($roles_id, $menu->id);
65
-            if(!$privilege->can_browse) {
65
+            if (!$privilege->can_browse) {
66 66
                 return false;
67 67
             }
68 68
         }
@@ -71,26 +71,26 @@  discard block
 block discarded – undo
71 71
     }
72 72
 
73 73
     public function all($withPrivilege = true) {
74
-        $roles_id = ($withPrivilege)?cb()->session()->roleId():null;
74
+        $roles_id = ($withPrivilege) ?cb()->session()->roleId() : null;
75 75
         $menus = $this->loadData();
76 76
         $result = [];
77
-        foreach($menus as $menu) {
77
+        foreach ($menus as $menu) {
78 78
 
79
-            if($withPrivilege && !$this->checkPrivilege($roles_id, $menu)) continue;
79
+            if ($withPrivilege && !$this->checkPrivilege($roles_id, $menu)) continue;
80 80
 
81 81
             $sidebarModel = $this->assignToModel($menu);
82
-            if($menus2 = $this->loadData($menu->id)) {
82
+            if ($menus2 = $this->loadData($menu->id)) {
83 83
                 $sub1 = [];
84 84
                 foreach ($menus2 as $menu2) {
85 85
 
86
-                    if($withPrivilege && !$this->checkPrivilege($roles_id, $menu2)) continue;
86
+                    if ($withPrivilege && !$this->checkPrivilege($roles_id, $menu2)) continue;
87 87
 
88 88
                     $sidebarModel2 = $this->assignToModel($menu2);
89
-                    if($menus3 = $this->loadData($menu2->id)) {
89
+                    if ($menus3 = $this->loadData($menu2->id)) {
90 90
                         $sub2 = [];
91 91
                         foreach ($menus3 as $menu3) {
92 92
 
93
-                            if($withPrivilege && !$this->checkPrivilege($roles_id, $menu3)) continue;
93
+                            if ($withPrivilege && !$this->checkPrivilege($roles_id, $menu3)) continue;
94 94
 
95 95
                             $sidebarModel3 = $this->assignToModel($menu3);
96 96
                             $sub2[] = $sidebarModel3;
Please login to merge, or discard this patch.
Braces   +12 added lines, -6 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(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);
@@ -49,7 +49,7 @@  discard block
 block discarded – undo
49 49
         $menus = DB::table("cb_menus");
50 50
         if($parent_id) {
51 51
             $menus->where("parent_cb_menus_id",$parent_id);
52
-        }else{
52
+        } else{
53 53
             $menus->whereNull("parent_cb_menus_id");
54 54
         }
55 55
         return $menus->orderBy("sort_number","asc")->get();
@@ -76,21 +76,27 @@  discard block
 block discarded – undo
76 76
         $result = [];
77 77
         foreach($menus as $menu) {
78 78
 
79
-            if($withPrivilege && !$this->checkPrivilege($roles_id, $menu)) continue;
79
+            if($withPrivilege && !$this->checkPrivilege($roles_id, $menu)) {
80
+                continue;
81
+            }
80 82
 
81 83
             $sidebarModel = $this->assignToModel($menu);
82 84
             if($menus2 = $this->loadData($menu->id)) {
83 85
                 $sub1 = [];
84 86
                 foreach ($menus2 as $menu2) {
85 87
 
86
-                    if($withPrivilege && !$this->checkPrivilege($roles_id, $menu2)) continue;
88
+                    if($withPrivilege && !$this->checkPrivilege($roles_id, $menu2)) {
89
+                        continue;
90
+                    }
87 91
 
88 92
                     $sidebarModel2 = $this->assignToModel($menu2);
89 93
                     if($menus3 = $this->loadData($menu2->id)) {
90 94
                         $sub2 = [];
91 95
                         foreach ($menus3 as $menu3) {
92 96
 
93
-                            if($withPrivilege && !$this->checkPrivilege($roles_id, $menu3)) continue;
97
+                            if($withPrivilege && !$this->checkPrivilege($roles_id, $menu3)) {
98
+                                continue;
99
+                            }
94 100
 
95 101
                             $sidebarModel3 = $this->assignToModel($menu3);
96 102
                             $sub2[] = $sidebarModel3;
Please login to merge, or discard this patch.
src/types/datetime/Hook.php 2 patches
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -20,9 +20,9 @@
 block discarded – undo
20 20
      */
21 21
     public function indexRender($row, $column)
22 22
     {
23
-        if($column->getFormat()) {
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.
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/types/date/Hook.php 2 patches
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -19,9 +19,9 @@
 block discarded – undo
19 19
      */
20 20
     public function indexRender($row, $column)
21 21
     {
22
-        if($column->getFormat()) {
22
+        if ($column->getFormat()) {
23 23
             return date($column->getFormat(), strtotime($row->{$column->getField()}));
24
-        }else{
24
+        } else {
25 25
             return $row->{$column->getField()};
26 26
         }
27 27
     }
Please login to merge, or discard this patch.
Braces   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -21,7 +21,7 @@
 block discarded – undo
21 21
     {
22 22
         if($column->getFormat()) {
23 23
             return date($column->getFormat(), strtotime($row->{$column->getField()}));
24
-        }else{
24
+        } else{
25 25
             return $row->{$column->getField()};
26 26
         }
27 27
     }
Please login to merge, or discard this patch.