@@ -60,7 +60,7 @@ discard block |
||
60 | 60 | } |
61 | 61 | ApiResponder::send($result, $posts, $this->ctrl); |
62 | 62 | } elseif (in_array($actionType, ['save_add', 'save_edit'])) { |
63 | - $rowAssign = array_filter($input_validator, function ($column) use ($table) { |
|
63 | + $rowAssign = array_filter($input_validator, function($column) use ($table) { |
|
64 | 64 | return Schema::hasColumn($table, $column); |
65 | 65 | }, ARRAY_FILTER_USE_KEY); |
66 | 66 | |
@@ -130,7 +130,7 @@ discard block |
||
130 | 130 | */ |
131 | 131 | private function filterRows($data, $parameters, $posts, $table, $typeExcept) |
132 | 132 | { |
133 | - $data->where(function ($w) use ($parameters, $posts, $table, $typeExcept) { |
|
133 | + $data->where(function($w) use ($parameters, $posts, $table, $typeExcept) { |
|
134 | 134 | foreach ($parameters as $param) { |
135 | 135 | $name = $param['name']; |
136 | 136 | $type = $param['type']; |
@@ -250,7 +250,7 @@ discard block |
||
250 | 250 | $rows->$k = asset($v); |
251 | 251 | } |
252 | 252 | |
253 | - if (! in_array($k, $responsesFields)) { |
|
253 | + if (!in_array($k, $responsesFields)) { |
|
254 | 254 | unset($rows->$k); |
255 | 255 | } |
256 | 256 | } |
@@ -303,7 +303,7 @@ discard block |
||
303 | 303 | */ |
304 | 304 | private function applyLike($data, $search_in, $value) |
305 | 305 | { |
306 | - $data->where(function ($w) use ($search_in, $value) { |
|
306 | + $data->where(function($w) use ($search_in, $value) { |
|
307 | 307 | foreach ($search_in as $k => $field) { |
308 | 308 | $method = 'orWhere'; |
309 | 309 | if ($k == 0) { |
@@ -324,7 +324,7 @@ discard block |
||
324 | 324 | */ |
325 | 325 | private function joinRelatedTables($table, $responsesFields, $name, $data, $nameTmp) |
326 | 326 | { |
327 | - if (! DbInspector::isForeignKey($name)) { |
|
327 | + if (!DbInspector::isForeignKey($name)) { |
|
328 | 328 | return $nameTmp; |
329 | 329 | } |
330 | 330 | $joinTable = DbInspector::getTableForeignKey($name); |
@@ -349,7 +349,7 @@ discard block |
||
349 | 349 | private function doValidation($inputValidator, $dataValidation, $posts) |
350 | 350 | { |
351 | 351 | $validator = Validator::make($inputValidator, $dataValidation); |
352 | - if (! $validator->fails()) { |
|
352 | + if (!$validator->fails()) { |
|
353 | 353 | return true; |
354 | 354 | } |
355 | 355 | $message = $validator->errors()->all(); |
@@ -365,11 +365,11 @@ discard block |
||
365 | 365 | */ |
366 | 366 | private function filterRedundantResp($responses) |
367 | 367 | { |
368 | - $responses = array_filter($responses, function ($resp) { |
|
369 | - return ! ($resp['name'] == 'ref_id' || $resp['type'] == 'custom'); |
|
368 | + $responses = array_filter($responses, function($resp) { |
|
369 | + return !($resp['name'] == 'ref_id' || $resp['type'] == 'custom'); |
|
370 | 370 | }); |
371 | 371 | |
372 | - $responses = array_filter($responses, function ($resp) { |
|
372 | + $responses = array_filter($responses, function($resp) { |
|
373 | 373 | return (intval($resp['used']) != 0 || DbInspector::isForeignKey($resp['name'])); |
374 | 374 | }); |
375 | 375 | |
@@ -384,15 +384,15 @@ discard block |
||
384 | 384 | private function validateParams($parameters, $table) |
385 | 385 | { |
386 | 386 | $posts = request()->all(); |
387 | - if (! $parameters) { |
|
387 | + if (!$parameters) { |
|
388 | 388 | return ['', '']; |
389 | 389 | } |
390 | 390 | $typeExcept = ['password', 'ref', 'base64_file', 'custom', 'search']; |
391 | 391 | $inputValidator = []; |
392 | 392 | $dataValidation = []; |
393 | 393 | |
394 | - $parameters = array_filter($parameters, function ($param){ |
|
395 | - return !(is_string($param['config'])&& !starts_with($param['config'], '*')); |
|
394 | + $parameters = array_filter($parameters, function($param) { |
|
395 | + return !(is_string($param['config']) && !starts_with($param['config'], '*')); |
|
396 | 396 | }); |
397 | 397 | |
398 | 398 | foreach ($parameters as $param) { |
@@ -18,7 +18,7 @@ discard block |
||
18 | 18 | { |
19 | 19 | $row = $data->first(); |
20 | 20 | |
21 | - if (! $row) { |
|
21 | + if (!$row) { |
|
22 | 22 | return ApiResponder::makeResult(0, 'There is no data found !'); |
23 | 23 | } |
24 | 24 | |
@@ -40,7 +40,7 @@ discard block |
||
40 | 40 | self::passwordError($posts, $ctrl); |
41 | 41 | } |
42 | 42 | |
43 | - if (! $required && $used && $value) { |
|
43 | + if (!$required && $used && $value) { |
|
44 | 44 | self::passwordError($posts, $ctrl); |
45 | 45 | } |
46 | 46 | } |
@@ -69,7 +69,7 @@ discard block |
||
69 | 69 | { |
70 | 70 | $result = ApiResponder::makeResult(1, 'success'); |
71 | 71 | |
72 | - return array_merge($result, (array)$rows); |
|
72 | + return array_merge($result, (array) $rows); |
|
73 | 73 | } |
74 | 74 | |
75 | 75 | /** |
@@ -83,7 +83,7 @@ discard block |
||
83 | 83 | $rows->$k = asset($v); |
84 | 84 | } |
85 | 85 | |
86 | - if (! in_array($k, $responsesFields)) { |
|
86 | + if (!in_array($k, $responsesFields)) { |
|
87 | 87 | unset($rows->$k); |
88 | 88 | } |
89 | 89 | } |