@@ -83,7 +83,7 @@ |
||
83 | 83 | |
84 | 84 | private function checkHideForm() |
85 | 85 | { |
86 | - if (! count($this->hide_form)) { |
|
86 | + if (!count($this->hide_form)) { |
|
87 | 87 | return null; |
88 | 88 | } |
89 | 89 | foreach ($this->form as $i => $f) { |
@@ -16,7 +16,7 @@ discard block |
||
16 | 16 | */ |
17 | 17 | public static function findPK($table) |
18 | 18 | { |
19 | - if (! $table) { |
|
19 | + if (!$table) { |
|
20 | 20 | return 'id'; |
21 | 21 | } |
22 | 22 | |
@@ -25,13 +25,13 @@ discard block |
||
25 | 25 | } |
26 | 26 | $table = CRUDBooster::parseSqlTable($table); |
27 | 27 | |
28 | - if (! $table['table']) { |
|
28 | + if (!$table['table']) { |
|
29 | 29 | throw new \Exception("parseSqlTable can't determine the table"); |
30 | 30 | } |
31 | 31 | |
32 | 32 | $primaryKey = self::findPKname($table); |
33 | 33 | |
34 | - if (! $primaryKey) { |
|
34 | + if (!$primaryKey) { |
|
35 | 35 | return 'id'; |
36 | 36 | } |
37 | 37 | CbCache::put('table_'.$table, 'primaryKey', $primaryKey); |
@@ -101,7 +101,7 @@ discard block |
||
101 | 101 | $cols = collect(DB::select('SELECT * FROM information_schema.COLUMNS WHERE TABLE_SCHEMA = :database AND TABLE_NAME = :table', [ |
102 | 102 | 'database' => $table['database'], |
103 | 103 | 'table' => $table['table'], |
104 | - ]))->map(function ($x) { |
|
104 | + ]))->map(function($x) { |
|
105 | 105 | return (array) $x; |
106 | 106 | })->toArray(); |
107 | 107 | |
@@ -117,7 +117,7 @@ discard block |
||
117 | 117 | { |
118 | 118 | $field = 'field_type_'.$table.'_'.$field; |
119 | 119 | |
120 | - return Cache::rememberForever($field, function () use ($table, $field) { |
|
120 | + return Cache::rememberForever($field, function() use ($table, $field) { |
|
121 | 121 | try { |
122 | 122 | //MySQL & SQL Server |
123 | 123 | $typedata = DB::select(DB::raw("select DATA_TYPE from INFORMATION_SCHEMA.COLUMNS where TABLE_NAME='$table' and COLUMN_NAME = '$field'"))[0]->DATA_TYPE; |
@@ -142,7 +142,7 @@ discard block |
||
142 | 142 | } |
143 | 143 | |
144 | 144 | $table = CRUDBooster::getTableForeignKey($fieldName); |
145 | - if (! $table) { |
|
145 | + if (!$table) { |
|
146 | 146 | return false; |
147 | 147 | } |
148 | 148 |
@@ -24,7 +24,7 @@ |
||
24 | 24 | function handle($result, $table) |
25 | 25 | { |
26 | 26 | $orderby = $this->ctrl->orderby; |
27 | - if (! $orderby) { |
|
27 | + if (!$orderby) { |
|
28 | 28 | $result->orderby($table.'.'.$this->ctrl->primaryKey, 'desc'); |
29 | 29 | return; |
30 | 30 | } |
@@ -16,7 +16,7 @@ discard block |
||
16 | 16 | { |
17 | 17 | $this->table = 'cms_moduls'; |
18 | 18 | $this->primaryKey = 'id'; |
19 | - $this->title_field = 'name' ; |
|
19 | + $this->title_field = 'name'; |
|
20 | 20 | $this->limit = 100; |
21 | 21 | $this->button_add = false; |
22 | 22 | $this->buttonExport = false; |
@@ -28,7 +28,7 @@ discard block |
||
28 | 28 | $this->orderby = ['is_protected' => 'asc', 'name' => 'asc']; |
29 | 29 | |
30 | 30 | $this->col = []; |
31 | - $this->col[] = ['label' => 'name', 'name' => 'name' ]; |
|
31 | + $this->col[] = ['label' => 'name', 'name' => 'name']; |
|
32 | 32 | $this->col[] = ['label' => "Table", 'name' => "table_name"]; |
33 | 33 | $this->col[] = ['label' => "Path", 'name' => "path"]; |
34 | 34 | $this->col[] = ['label' => "Controller", 'name' => "controller"]; |
@@ -250,7 +250,7 @@ discard block |
||
250 | 250 | $this->form[] = ['label' => 'Controller', 'name' => 'controller', 'type' => 'text', 'placeholder' => '(Optional) Auto Generated']; |
251 | 251 | |
252 | 252 | if (in_array(CRUDBooster::getCurrentMethod(), ['getAdd', 'postAddSave'])) { |
253 | - return ; |
|
253 | + return; |
|
254 | 254 | } |
255 | 255 | |
256 | 256 | $this->form[] = [ |
@@ -225,7 +225,7 @@ discard block |
||
225 | 225 | */ |
226 | 226 | private function filterRows($data, $parameters, $posts, $table, $typeExcept) |
227 | 227 | { |
228 | - $data->where(function ($w) use ($parameters, $posts, $table, $typeExcept) { |
|
228 | + $data->where(function($w) use ($parameters, $posts, $table, $typeExcept) { |
|
229 | 229 | foreach ($parameters as $param) { |
230 | 230 | $name = $param['name']; |
231 | 231 | $type = $param['type']; |
@@ -317,7 +317,7 @@ discard block |
||
317 | 317 | $row->$k = asset($v); |
318 | 318 | } |
319 | 319 | |
320 | - if (! in_array($k, $responsesFields)) { |
|
320 | + if (!in_array($k, $responsesFields)) { |
|
321 | 321 | unset($row[$k]); |
322 | 322 | } |
323 | 323 | } |
@@ -380,7 +380,7 @@ discard block |
||
380 | 380 | $rows->$k = asset($v); |
381 | 381 | } |
382 | 382 | |
383 | - if (! in_array($k, $responsesFields)) { |
|
383 | + if (!in_array($k, $responsesFields)) { |
|
384 | 384 | unset($row[$k]); |
385 | 385 | } |
386 | 386 | } |
@@ -403,7 +403,7 @@ discard block |
||
403 | 403 | $subquery = $resp['subquery']; |
404 | 404 | $used = intval($resp['used']); |
405 | 405 | |
406 | - if ($used == 0 && ! DbInspector::isForeignKey($name)) { |
|
406 | + if ($used == 0 && !DbInspector::isForeignKey($name)) { |
|
407 | 407 | continue; |
408 | 408 | } |
409 | 409 | |
@@ -443,7 +443,7 @@ discard block |
||
443 | 443 | $result['api_status'] = 1; |
444 | 444 | $result['api_message'] = 'success'; |
445 | 445 | if (cbGetsetting('api_debug_mode') == 'true') { |
446 | - $result['api_authorization']=$debugModeMessage; |
|
446 | + $result['api_authorization'] = $debugModeMessage; |
|
447 | 447 | } |
448 | 448 | $rows = (array) $rows; |
449 | 449 | $result = array_merge($result, $rows); |
@@ -458,7 +458,7 @@ discard block |
||
458 | 458 | */ |
459 | 459 | private function applyLike($data, $search_in, $value) |
460 | 460 | { |
461 | - $data->where(function ($w) use ($search_in, $value) { |
|
461 | + $data->where(function($w) use ($search_in, $value) { |
|
462 | 462 | foreach ($search_in as $k => $field) { |
463 | 463 | if ($k == 0) { |
464 | 464 | $w->where($field, "like", "%$value%"); |
@@ -506,7 +506,7 @@ discard block |
||
506 | 506 | private function validateMethodType($row_api, $result, $debugModeMessage, $posts) |
507 | 507 | { |
508 | 508 | $method_type = $row_api->method_type; |
509 | - if (! $method_type || ! Request::isMethod($method_type)) { |
|
509 | + if (!$method_type || !Request::isMethod($method_type)) { |
|
510 | 510 | $result['api_status'] = 0; |
511 | 511 | $result['api_message'] = "The request method is not allowed !"; |
512 | 512 | |
@@ -544,7 +544,7 @@ discard block |
||
544 | 544 | */ |
545 | 545 | private function checkApiDefined($row_api, $result, $debugModeMessage, $posts) |
546 | 546 | { |
547 | - if (! $row_api) { |
|
547 | + if (!$row_api) { |
|
548 | 548 | $result['api_status'] = 0; |
549 | 549 | $result['api_message'] = 'Sorry this API is no longer available, maybe has changed by admin, or please make sure api url is correct.'; |
550 | 550 | |
@@ -614,11 +614,11 @@ discard block |
||
614 | 614 | $value = $param['config']; |
615 | 615 | } |
616 | 616 | |
617 | - if ($required && $type == 'password' && ! Hash::check($value, $row->{$name})) { |
|
617 | + if ($required && $type == 'password' && !Hash::check($value, $row->{$name})) { |
|
618 | 618 | $this->passwordError($result, $debugModeMessage, $posts); |
619 | 619 | } |
620 | 620 | |
621 | - if (! $required && $used && $value && ! Hash::check($value, $row->{$name})) { |
|
621 | + if (!$required && $used && $value && !Hash::check($value, $row->{$name})) { |
|
622 | 622 | $this->passwordError($result, $debugModeMessage, $posts); |
623 | 623 | } |
624 | 624 | } |