Passed
Pull Request — master (#1139)
by Iman
03:41
created
src/controllers/ApiController/ExecuteApi.php 1 patch
Spacing   +13 added lines, -13 removed lines patch added patch discarded remove patch
@@ -117,7 +117,7 @@  discard block
 block discarded – undo
117 117
         }
118 118
 
119 119
         if (in_array($actionType, ['save_add', 'save_edit'])) {
120
-            $rowAssign = array_filter($input_validator, function ($column) use ($table) {
120
+            $rowAssign = array_filter($input_validator, function($column) use ($table) {
121 121
                 return Schema::hasColumn($table, $column);
122 122
             }, ARRAY_FILTER_USE_KEY);
123 123
 
@@ -229,7 +229,7 @@  discard block
 block discarded – undo
229 229
      */
230 230
     private function filterRows($data, $parameters, $posts, $table, $typeExcept)
231 231
     {
232
-        $data->where(function ($w) use ($parameters, $posts, $table, $typeExcept) {
232
+        $data->where(function($w) use ($parameters, $posts, $table, $typeExcept) {
233 233
             foreach ($parameters as $param) {
234 234
                 $name = $param['name'];
235 235
                 $type = $param['type'];
@@ -320,7 +320,7 @@  discard block
 block discarded – undo
320 320
                     $row->$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
             }
@@ -383,7 +383,7 @@  discard block
 block discarded – undo
383 383
                 $rows->$k = asset($v);
384 384
             }
385 385
 
386
-            if (! in_array($k, $responsesFields)) {
386
+            if (!in_array($k, $responsesFields)) {
387 387
                 unset($row[$k]);
388 388
             }
389 389
         }
@@ -455,7 +455,7 @@  discard block
 block discarded – undo
455 455
      */
456 456
     private function applyLike($data, $search_in, $value)
457 457
     {
458
-        $data->where(function ($w) use ($search_in, $value) {
458
+        $data->where(function($w) use ($search_in, $value) {
459 459
             foreach ($search_in as $k => $field) {
460 460
                 if ($k == 0) {
461 461
                     $w->where($field, "like", "%$value%");
@@ -476,7 +476,7 @@  discard block
 block discarded – undo
476 476
      */
477 477
     private function joinRelatedTables($table, $responsesFields, $name, $data, $nameTmp)
478 478
     {
479
-        if (! DbInspector::isForeignKey($name)) {
479
+        if (!DbInspector::isForeignKey($name)) {
480 480
             return $nameTmp;
481 481
         }
482 482
         $jointable = DbInspector::getTableForeignKey($name);
@@ -503,7 +503,7 @@  discard block
 block discarded – undo
503 503
     private function validateMethodType($row_api, $result, $debugModeMessage, $posts)
504 504
     {
505 505
         $methodType = $row_api->method_type;
506
-        if (! $methodType || ! Request::isMethod($methodType)) {
506
+        if (!$methodType || !Request::isMethod($methodType)) {
507 507
             $result['api_status'] = 0;
508 508
             $result['api_message'] = "The request method is not allowed !";
509 509
 
@@ -541,7 +541,7 @@  discard block
 block discarded – undo
541 541
      */
542 542
     private function checkApiDefined($row_api, $result, $debugModeMessage, $posts)
543 543
     {
544
-        if (! $row_api) {
544
+        if (!$row_api) {
545 545
             $result['api_status'] = 0;
546 546
             $result['api_message'] = 'Sorry this API is no longer available, maybe has changed by admin, or please make sure api url is correct.';
547 547
 
@@ -611,11 +611,11 @@  discard block
 block discarded – undo
611 611
                     $value = $param['config'];
612 612
                 }
613 613
 
614
-                if ($required && $type == 'password' && ! Hash::check($value, $row->{$name})) {
614
+                if ($required && $type == 'password' && !Hash::check($value, $row->{$name})) {
615 615
                     $this->passwordError($result, $debugModeMessage, $posts);
616 616
                 }
617 617
 
618
-                if (! $required && $used && $value && ! Hash::check($value, $row->{$name})) {
618
+                if (!$required && $used && $value && !Hash::check($value, $row->{$name})) {
619 619
                     $this->passwordError($result, $debugModeMessage, $posts);
620 620
                 }
621 621
             }
@@ -633,11 +633,11 @@  discard block
 block discarded – undo
633 633
      */
634 634
     private function filterRedundantResp($responses)
635 635
     {
636
-        $responses = array_filter($responses, function ($resp) {
637
-            return ! ($resp['name'] == 'ref_id' || $resp['type'] == 'custom');
636
+        $responses = array_filter($responses, function($resp) {
637
+            return !($resp['name'] == 'ref_id' || $resp['type'] == 'custom');
638 638
         });
639 639
 
640
-        $responses = array_filter($responses, function ($resp) {
640
+        $responses = array_filter($responses, function($resp) {
641 641
             return (intval($resp['used']) != 0 || DbInspector::isForeignKey($resp['name']));
642 642
         });
643 643
 
Please login to merge, or discard this patch.