@@ -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 | $primary_key = self::findPKname($table); |
33 | 33 | |
34 | - if (! $primary_key) { |
|
34 | + if (!$primary_key) { |
|
35 | 35 | return 'id'; |
36 | 36 | } |
37 | 37 | CbCache::put('table_'.$table, 'primary_key', $primary_key); |
@@ -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 |
@@ -14,7 +14,7 @@ |
||
14 | 14 | public function boot() |
15 | 15 | { |
16 | 16 | $this->app['view']->addNamespace('CbEmailTpl', __DIR__.'/views'); |
17 | - $this->loadRoutesFrom( __DIR__.'/email_templates_routes.php'); |
|
17 | + $this->loadRoutesFrom(__DIR__.'/email_templates_routes.php'); |
|
18 | 18 | } |
19 | 19 | |
20 | 20 | /** |
@@ -76,7 +76,7 @@ |
||
76 | 76 | */ |
77 | 77 | private function chechExtension($extension) |
78 | 78 | { |
79 | - if (! extension_loaded($extension)) { |
|
79 | + if (!extension_loaded($extension)) { |
|
80 | 80 | $this->console->info($extension.' extension: [Bad]'); |
81 | 81 | return $this->requirements = false; |
82 | 82 | } |
@@ -229,7 +229,7 @@ |
||
229 | 229 | |
230 | 230 | public static function stringify($input, $indent = "") |
231 | 231 | { |
232 | - if (! is_array($input)) { |
|
232 | + if (!is_array($input)) { |
|
233 | 233 | return var_export($input, true); |
234 | 234 | } |
235 | 235 | $buffer = []; |
@@ -9,8 +9,8 @@ |
||
9 | 9 | $colsItem = self::extractLines($code, $type); |
10 | 10 | |
11 | 11 | foreach ($colsItem as &$item) { |
12 | - $item = str_replace(' ','', $item); |
|
13 | - $item = str_replace('\',]',']', $item); |
|
12 | + $item = str_replace(' ', '', $item); |
|
13 | + $item = str_replace('\',]', ']', $item); |
|
14 | 14 | $item = trim($item); |
15 | 15 | $item = trim($item, '['); |
16 | 16 | $item = trim($item, '];'); |
@@ -61,7 +61,7 @@ |
||
61 | 61 | $columnScript[] = ' $this->col[] = [];'; |
62 | 62 | foreach ($labels as $i => $label) { |
63 | 63 | |
64 | - if (! $name[$i]) { |
|
64 | + if (!$name[$i]) { |
|
65 | 65 | continue; |
66 | 66 | } |
67 | 67 |
@@ -153,7 +153,7 @@ discard block |
||
153 | 153 | public static function first($table, $id) |
154 | 154 | { |
155 | 155 | $table = self::parseSqlTable($table)['table']; |
156 | - if (! is_array($id)) { |
|
156 | + if (!is_array($id)) { |
|
157 | 157 | $pk = self::pk($table); |
158 | 158 | |
159 | 159 | return DB::table($table)->where($pk, $id)->first(); |
@@ -247,7 +247,7 @@ discard block |
||
247 | 247 | $controllerName = basename($controllerName); |
248 | 248 | $route_url = route($controllerName.'GetIndex'); |
249 | 249 | |
250 | - if (! $path) { |
|
250 | + if (!$path) { |
|
251 | 251 | return trim($route_url, '/'); |
252 | 252 | } |
253 | 253 |
@@ -9,7 +9,7 @@ |
||
9 | 9 | @$get = $_GET; |
10 | 10 | $inputhtml = ''; |
11 | 11 | |
12 | - if (! $get) { |
|
12 | + if (!$get) { |
|
13 | 13 | return $inputhtml; |
14 | 14 | } |
15 | 15 | if (is_array($exception)) { |
@@ -53,11 +53,11 @@ discard block |
||
53 | 53 | | ---------------------------------------------- |
54 | 54 | | |
55 | 55 | */ |
56 | - if (! $row_api->method_type) { |
|
56 | + if (!$row_api->method_type) { |
|
57 | 57 | return; |
58 | 58 | } |
59 | 59 | $method_type = $row_api->method_type; |
60 | - if ($method_type && ! Request::isMethod($method_type)) { |
|
60 | + if ($method_type && !Request::isMethod($method_type)) { |
|
61 | 61 | $result['api_status'] = 0; |
62 | 62 | $result['api_message'] = "The request method is not allowed !"; |
63 | 63 | |
@@ -70,7 +70,7 @@ discard block |
||
70 | 70 | | ---------------------------------------------- |
71 | 71 | | |
72 | 72 | */ |
73 | - if (! $row_api) { |
|
73 | + if (!$row_api) { |
|
74 | 74 | $result['api_status'] = 0; |
75 | 75 | $result['api_message'] = 'Sorry this API is no longer available, maybe has changed by admin, or please make sure api url is correct.'; |
76 | 76 | |
@@ -173,11 +173,11 @@ discard block |
||
173 | 173 | $value = $param['config']; |
174 | 174 | } |
175 | 175 | |
176 | - if ($required && $type == 'password' && ! Hash::check($value, $rows->{$name})) { |
|
176 | + if ($required && $type == 'password' && !Hash::check($value, $rows->{$name})) { |
|
177 | 177 | return $this->passwordError($result, $debug_mode_message, $posts); |
178 | 178 | } |
179 | 179 | |
180 | - if (! $required && $used && $value && ! Hash::check($value, $row->{$name})) { |
|
180 | + if (!$required && $used && $value && !Hash::check($value, $row->{$name})) { |
|
181 | 181 | return $this->passwordError($result, $debug_mode_message, $posts); |
182 | 182 | } |
183 | 183 | } |
@@ -304,7 +304,7 @@ discard block |
||
304 | 304 | */ |
305 | 305 | private function filterRows($data, $parameters, $posts, $table, $type_except) |
306 | 306 | { |
307 | - $data->where(function ($w) use ($parameters, $posts, $table, $type_except) { |
|
307 | + $data->where(function($w) use ($parameters, $posts, $table, $type_except) { |
|
308 | 308 | foreach ($parameters as $param) { |
309 | 309 | $name = $param['name']; |
310 | 310 | $type = $param['type']; |
@@ -396,7 +396,7 @@ discard block |
||
396 | 396 | $row->$k = asset($v); |
397 | 397 | } |
398 | 398 | |
399 | - if (! in_array($k, $responses_fields)) { |
|
399 | + if (!in_array($k, $responses_fields)) { |
|
400 | 400 | unset($row[$k]); |
401 | 401 | } |
402 | 402 | } |
@@ -459,7 +459,7 @@ discard block |
||
459 | 459 | $rows->$k = asset($v); |
460 | 460 | } |
461 | 461 | |
462 | - if (! in_array($k, $responses_fields)) { |
|
462 | + if (!in_array($k, $responses_fields)) { |
|
463 | 463 | unset($row[$k]); |
464 | 464 | } |
465 | 465 | } |
@@ -481,7 +481,7 @@ discard block |
||
481 | 481 | $subquery = $resp['subquery']; |
482 | 482 | $used = intval($resp['used']); |
483 | 483 | |
484 | - if ($used == 0 && ! DbInspector::isForeignKey($name)) { |
|
484 | + if ($used == 0 && !DbInspector::isForeignKey($name)) { |
|
485 | 485 | continue; |
486 | 486 | } |
487 | 487 | |
@@ -536,7 +536,7 @@ discard block |
||
536 | 536 | */ |
537 | 537 | private function applyLike($data, $search_in, $value) |
538 | 538 | { |
539 | - $data->where(function ($w) use ($search_in, $value) { |
|
539 | + $data->where(function($w) use ($search_in, $value) { |
|
540 | 540 | foreach ($search_in as $k => $field) { |
541 | 541 | if ($k == 0) { |
542 | 542 | $w->where($field, "like", "%$value%"); |