Passed
Push — master ( 93545d...396998 )
by Iman
04:46
created
src/controllers/ApiController/ExecuteApi.php 1 patch
Spacing   +15 added lines, -15 removed lines patch added patch discarded remove patch
@@ -76,7 +76,7 @@  discard block
 block discarded – undo
76 76
                 $result = $this->handleDeleteAction($table, $data);
77 77
             }
78 78
         } elseif (in_array($actionType, ['save_add', 'save_edit'])) {
79
-            $rowAssign = array_filter($input_validator, function ($column) use ($table) {
79
+            $rowAssign = array_filter($input_validator, function($column) use ($table) {
80 80
                 return Schema::hasColumn($table, $column);
81 81
             }, ARRAY_FILTER_USE_KEY);
82 82
 
@@ -178,7 +178,7 @@  discard block
 block discarded – undo
178 178
      */
179 179
     private function filterRows($data, $parameters, $posts, $table, $typeExcept)
180 180
     {
181
-        $data->where(function ($w) use ($parameters, $posts, $table, $typeExcept) {
181
+        $data->where(function($w) use ($parameters, $posts, $table, $typeExcept) {
182 182
             foreach ($parameters as $param) {
183 183
                 $name = $param['name'];
184 184
                 $type = $param['type'];
@@ -267,7 +267,7 @@  discard block
 block discarded – undo
267 267
                     $row->$k = asset($v);
268 268
                 }
269 269
 
270
-                if (! in_array($k, $responsesFields)) {
270
+                if (!in_array($k, $responsesFields)) {
271 271
                     unset($row[$k]);
272 272
                 }
273 273
             }
@@ -320,7 +320,7 @@  discard block
 block discarded – undo
320 320
                 $rows->$k = asset($v);
321 321
             }
322 322
 
323
-            if (! in_array($k, $responsesFields)) {
323
+            if (!in_array($k, $responsesFields)) {
324 324
                 unset($row[$k]);
325 325
             }
326 326
         }
@@ -373,7 +373,7 @@  discard block
 block discarded – undo
373 373
     private function success($rows)
374 374
     {
375 375
         $result = $this->makeResult(1, 'success');
376
-        $rows = (array)$rows;
376
+        $rows = (array) $rows;
377 377
         $result = array_merge($result, $rows);
378 378
 
379 379
         return $result;
@@ -386,7 +386,7 @@  discard block
 block discarded – undo
386 386
      */
387 387
     private function applyLike($data, $search_in, $value)
388 388
     {
389
-        $data->where(function ($w) use ($search_in, $value) {
389
+        $data->where(function($w) use ($search_in, $value) {
390 390
             foreach ($search_in as $k => $field) {
391 391
                 if ($k == 0) {
392 392
                     $w->where($field, "like", "%$value%");
@@ -407,7 +407,7 @@  discard block
 block discarded – undo
407 407
      */
408 408
     private function joinRelatedTables($table, $responsesFields, $name, $data, $nameTmp)
409 409
     {
410
-        if (! DbInspector::isForeignKey($name)) {
410
+        if (!DbInspector::isForeignKey($name)) {
411 411
             return $nameTmp;
412 412
         }
413 413
         $jointable = DbInspector::getTableForeignKey($name);
@@ -447,7 +447,7 @@  discard block
 block discarded – undo
447 447
         $posts = request()->all();
448 448
         $this->ctrl->hookValidate($posts);
449 449
 
450
-        if (! $this->ctrl->validate) {
450
+        if (!$this->ctrl->validate) {
451 451
             return true;
452 452
         }  // hook have to return true
453 453
 
@@ -482,7 +482,7 @@  discard block
 block discarded – undo
482 482
     private function doValidation($input_validator, $data_validation, $posts)
483 483
     {
484 484
         $validator = Validator::make($input_validator, $data_validation);
485
-        if (! $validator->fails()) {
485
+        if (!$validator->fails()) {
486 486
             return true;
487 487
         }
488 488
         $message = $validator->errors()->all();
@@ -505,7 +505,7 @@  discard block
 block discarded – undo
505 505
     {
506 506
         $row = $data->first();
507 507
 
508
-        if (! $row) {
508
+        if (!$row) {
509 509
             return $this->makeResult(0, 'There is no data found !');
510 510
         }
511 511
 
@@ -527,7 +527,7 @@  discard block
 block discarded – undo
527 527
                 $this->passwordError($posts);
528 528
             }
529 529
 
530
-            if (! $required && $used && $value) {
530
+            if (!$required && $used && $value) {
531 531
                 $this->passwordError($posts);
532 532
             }
533 533
         }
@@ -543,11 +543,11 @@  discard block
 block discarded – undo
543 543
      */
544 544
     private function filterRedundantResp($responses)
545 545
     {
546
-        $responses = array_filter($responses, function ($resp) {
547
-            return ! ($resp['name'] == 'ref_id' || $resp['type'] == 'custom');
546
+        $responses = array_filter($responses, function($resp) {
547
+            return !($resp['name'] == 'ref_id' || $resp['type'] == 'custom');
548 548
         });
549 549
 
550
-        $responses = array_filter($responses, function ($resp) {
550
+        $responses = array_filter($responses, function($resp) {
551 551
             return (intval($resp['used']) != 0 || DbInspector::isForeignKey($resp['name']));
552 552
         });
553 553
 
@@ -563,7 +563,7 @@  discard block
 block discarded – undo
563 563
     private function validateParams($parameters, $table)
564 564
     {
565 565
         $posts = request()->all();
566
-        if (! $parameters) {
566
+        if (!$parameters) {
567 567
             return ['', ''];
568 568
         }
569 569
         $typeExcept = ['password', 'ref', 'base64_file', 'custom', 'search'];
Please login to merge, or discard this patch.