@@ -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[] = [ |
@@ -226,7 +226,7 @@ discard block |
||
226 | 226 | */ |
227 | 227 | private function filterRows($data, $parameters, $posts, $table, $typeExcept) |
228 | 228 | { |
229 | - $data->where(function ($w) use ($parameters, $posts, $table, $typeExcept) { |
|
229 | + $data->where(function($w) use ($parameters, $posts, $table, $typeExcept) { |
|
230 | 230 | foreach ($parameters as $param) { |
231 | 231 | $name = $param['name']; |
232 | 232 | $type = $param['type']; |
@@ -318,7 +318,7 @@ discard block |
||
318 | 318 | $row->$k = asset($v); |
319 | 319 | } |
320 | 320 | |
321 | - if (! in_array($k, $responsesFields)) { |
|
321 | + if (!in_array($k, $responsesFields)) { |
|
322 | 322 | unset($row[$k]); |
323 | 323 | } |
324 | 324 | } |
@@ -381,7 +381,7 @@ discard block |
||
381 | 381 | $rows->$k = asset($v); |
382 | 382 | } |
383 | 383 | |
384 | - if (! in_array($k, $responsesFields)) { |
|
384 | + if (!in_array($k, $responsesFields)) { |
|
385 | 385 | unset($row[$k]); |
386 | 386 | } |
387 | 387 | } |
@@ -404,7 +404,7 @@ discard block |
||
404 | 404 | $subquery = $resp['subquery']; |
405 | 405 | $used = intval($resp['used']); |
406 | 406 | |
407 | - if ($used == 0 && ! DbInspector::isForeignKey($name)) { |
|
407 | + if ($used == 0 && !DbInspector::isForeignKey($name)) { |
|
408 | 408 | continue; |
409 | 409 | } |
410 | 410 | |
@@ -459,7 +459,7 @@ discard block |
||
459 | 459 | */ |
460 | 460 | private function applyLike($data, $search_in, $value) |
461 | 461 | { |
462 | - $data->where(function ($w) use ($search_in, $value) { |
|
462 | + $data->where(function($w) use ($search_in, $value) { |
|
463 | 463 | foreach ($search_in as $k => $field) { |
464 | 464 | if ($k == 0) { |
465 | 465 | $w->where($field, "like", "%$value%"); |
@@ -507,7 +507,7 @@ discard block |
||
507 | 507 | private function validateMethodType($row_api, $result, $debugModeMessage, $posts) |
508 | 508 | { |
509 | 509 | $method_type = $row_api->method_type; |
510 | - if (! $method_type || ! Request::isMethod($method_type)) { |
|
510 | + if (!$method_type || !Request::isMethod($method_type)) { |
|
511 | 511 | $result['api_status'] = 0; |
512 | 512 | $result['api_message'] = "The request method is not allowed !"; |
513 | 513 | |
@@ -545,7 +545,7 @@ discard block |
||
545 | 545 | */ |
546 | 546 | private function checkApiDefined($row_api, $result, $debugModeMessage, $posts) |
547 | 547 | { |
548 | - if (! $row_api) { |
|
548 | + if (!$row_api) { |
|
549 | 549 | $result['api_status'] = 0; |
550 | 550 | $result['api_message'] = 'Sorry this API is no longer available, maybe has changed by admin, or please make sure api url is correct.'; |
551 | 551 | |
@@ -615,11 +615,11 @@ discard block |
||
615 | 615 | $value = $param['config']; |
616 | 616 | } |
617 | 617 | |
618 | - if ($required && $type == 'password' && ! Hash::check($value, $row->{$name})) { |
|
618 | + if ($required && $type == 'password' && !Hash::check($value, $row->{$name})) { |
|
619 | 619 | $this->passwordError($result, $debugModeMessage, $posts); |
620 | 620 | } |
621 | 621 | |
622 | - if (! $required && $used && $value && ! Hash::check($value, $row->{$name})) { |
|
622 | + if (!$required && $used && $value && !Hash::check($value, $row->{$name})) { |
|
623 | 623 | $this->passwordError($result, $debugModeMessage, $posts); |
624 | 624 | } |
625 | 625 | } |