Passed
Push — master ( 21d85a...18548d )
by Iman
04:31
created
src/controllers/ApiController/ExecuteApi.php 1 patch
Spacing   +11 added lines, -11 removed lines patch added patch discarded remove patch
@@ -60,7 +60,7 @@  discard block
 block discarded – undo
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
 
@@ -113,7 +113,7 @@  discard block
 block discarded – undo
113 113
      */
114 114
     private function filterRows($data, $parameters, $posts, $table, $typeExcept)
115 115
     {
116
-        $data->where(function ($w) use ($parameters, $posts, $table, $typeExcept) {
116
+        $data->where(function($w) use ($parameters, $posts, $table, $typeExcept) {
117 117
             foreach ($parameters as $param) {
118 118
                 $name = $param['name'];
119 119
                 $type = $param['type'];
@@ -251,7 +251,7 @@  discard block
 block discarded – undo
251 251
      */
252 252
     private function applyLike($data, $search_in, $value)
253 253
     {
254
-        $data->where(function ($w) use ($search_in, $value) {
254
+        $data->where(function($w) use ($search_in, $value) {
255 255
             foreach ($search_in as $k => $field) {
256 256
                 $method = 'orWhere';
257 257
                 if ($k == 0) {
@@ -272,7 +272,7 @@  discard block
 block discarded – undo
272 272
      */
273 273
     private function joinRelatedTables($table, $responsesFields, $name, $data, $nameTmp)
274 274
     {
275
-        if (! DbInspector::isForeignKey($name)) {
275
+        if (!DbInspector::isForeignKey($name)) {
276 276
             return $nameTmp;
277 277
         }
278 278
         $joinTable = DbInspector::getTableForeignKey($name);
@@ -297,7 +297,7 @@  discard block
 block discarded – undo
297 297
     private function doValidation($inputValidator, $dataValidation, $posts)
298 298
     {
299 299
         $validator = Validator::make($inputValidator, $dataValidation);
300
-        if (! $validator->fails()) {
300
+        if (!$validator->fails()) {
301 301
             return true;
302 302
         }
303 303
         $message = $validator->errors()->all();
@@ -313,11 +313,11 @@  discard block
 block discarded – undo
313 313
      */
314 314
     private function filterRedundantResp($responses)
315 315
     {
316
-        $responses = array_filter($responses, function ($resp) {
317
-            return ! ($resp['name'] == 'ref_id' || $resp['type'] == 'custom');
316
+        $responses = array_filter($responses, function($resp) {
317
+            return !($resp['name'] == 'ref_id' || $resp['type'] == 'custom');
318 318
         });
319 319
 
320
-        $responses = array_filter($responses, function ($resp) {
320
+        $responses = array_filter($responses, function($resp) {
321 321
             return (intval($resp['used']) != 0 || DbInspector::isForeignKey($resp['name']));
322 322
         });
323 323
 
@@ -332,15 +332,15 @@  discard block
 block discarded – undo
332 332
     private function validateParams($parameters, $table)
333 333
     {
334 334
         $posts = request()->all();
335
-        if (! $parameters) {
335
+        if (!$parameters) {
336 336
             return ['', ''];
337 337
         }
338 338
         $typeExcept = ['password', 'ref', 'base64_file', 'custom', 'search'];
339 339
         $inputValidator = [];
340 340
         $dataValidation = [];
341 341
 
342
-        $parameters = array_filter($parameters, function ($param){
343
-            return !(is_string($param['config'])&& !starts_with($param['config'], '*'));
342
+        $parameters = array_filter($parameters, function($param) {
343
+            return !(is_string($param['config']) && !starts_with($param['config'], '*'));
344 344
         });
345 345
 
346 346
         foreach ($parameters as $param) {
Please login to merge, or discard this patch.