Passed
Pull Request — master (#1136)
by Iman
04:10
created
src/CBCoreModule/Index.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -108,7 +108,7 @@  discard block
 block discarded – undo
108 108
             $data['parent_field'] = DbInspector::getTableForeignKey(request('parent_table'), $this->table);
109 109
         }
110 110
 
111
-        if (! $data['parent_field']) {
111
+        if (!$data['parent_field']) {
112 112
             return $data;
113 113
         }
114 114
 
@@ -126,7 +126,7 @@  discard block
 block discarded – undo
126 126
      */
127 127
     private function _filterForParent($result)
128 128
     {
129
-        if (! request('parent_id')) {
129
+        if (!request('parent_id')) {
130 130
             return null;
131 131
         }
132 132
 
@@ -140,7 +140,7 @@  discard block
 block discarded – undo
140 140
      */
141 141
     private function _filterOutSoftDeleted($tableColumns, $result)
142 142
     {
143
-        if (! in_array('deleted_at', $tableColumns)) {
143
+        if (!in_array('deleted_at', $tableColumns)) {
144 144
             return;
145 145
         }
146 146
         $result->where($this->table.'.deleted_at', '=', null);
@@ -199,9 +199,9 @@  discard block
 block discarded – undo
199 199
     private function _applyWhereAndQfilters($result, $columnsTable, $table)
200 200
     {
201 201
         if (request('q')) {
202
-            $result->where(function ($query) use ($columnsTable) {
202
+            $result->where(function($query) use ($columnsTable) {
203 203
                 foreach ($columnsTable as $col) {
204
-                    if (! $col['field_with']) {
204
+                    if (!$col['field_with']) {
205 205
                         continue;
206 206
                     }
207 207
                     $query->orwhere($col['field_with'], "like", "%".request("q")."%");
@@ -273,7 +273,7 @@  discard block
 block discarded – undo
273 273
         return CRUDBooster::adminPath($module['path']).'?parent_table='.$table_parent.'&parent_columns='
274 274
             .$module['parent_columns'].'&parent_columns_alias='
275 275
             .$module['parent_columns_alias'].'&parent_id=['
276
-            .(! isset($module['custom_parent_id']) ? "id" : $module['custom_parent_id'])
276
+            .(!isset($module['custom_parent_id']) ? "id" : $module['custom_parent_id'])
277 277
             .']&return_url='.urlencode(Request::fullUrl()).'&foreign_key='
278 278
             .$module['foreign_key'].'&label='.urlencode($module['label']);
279 279
     }
Please login to merge, or discard this patch.
src/controllers/ApiController/ExecuteApi.php 1 patch
Spacing   +11 added lines, -11 removed lines patch added patch discarded remove patch
@@ -116,7 +116,7 @@  discard block
 block discarded – undo
116 116
         }
117 117
 
118 118
         if (in_array($actionType, ['save_add', 'save_edit'])) {
119
-            $rowAssign = array_filter($input_validator, function ($column) use ($table) {
119
+            $rowAssign = array_filter($input_validator, function($column) use ($table) {
120 120
                 return \Schema::hasColumn($table, $column);
121 121
             }, ARRAY_FILTER_USE_KEY);
122 122
 
@@ -228,7 +228,7 @@  discard block
 block discarded – undo
228 228
      */
229 229
     private function filterRows($data, $parameters, $posts, $table, $typeExcept)
230 230
     {
231
-        $data->where(function ($w) use ($parameters, $posts, $table, $typeExcept) {
231
+        $data->where(function($w) use ($parameters, $posts, $table, $typeExcept) {
232 232
             foreach ($parameters as $param) {
233 233
                 $name = $param['name'];
234 234
                 $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
         }
@@ -406,7 +406,7 @@  discard block
 block discarded – undo
406 406
             $subquery = $resp['subquery'];
407 407
             $used = intval($resp['used']);
408 408
 
409
-            if ($used == 0 && ! DbInspector::isForeignKey($name)) {
409
+            if ($used == 0 && !DbInspector::isForeignKey($name)) {
410 410
                 continue;
411 411
             }
412 412
 
@@ -461,7 +461,7 @@  discard block
 block discarded – undo
461 461
      */
462 462
     private function applyLike($data, $search_in, $value)
463 463
     {
464
-        $data->where(function ($w) use ($search_in, $value) {
464
+        $data->where(function($w) use ($search_in, $value) {
465 465
             foreach ($search_in as $k => $field) {
466 466
                 if ($k == 0) {
467 467
                     $w->where($field, "like", "%$value%");
@@ -482,7 +482,7 @@  discard block
 block discarded – undo
482 482
      */
483 483
     private function joinRelatedTables($table, $responsesFields, $name, $data, $nameTmp)
484 484
     {
485
-        if (! DbInspector::isForeignKey($name)) {
485
+        if (!DbInspector::isForeignKey($name)) {
486 486
             return $nameTmp;
487 487
         }
488 488
         $jointable = DbInspector::getTableForeignKey($name);
@@ -509,7 +509,7 @@  discard block
 block discarded – undo
509 509
     private function validateMethodType($row_api, $result, $debugModeMessage, $posts)
510 510
     {
511 511
         $methodType = $row_api->method_type;
512
-        if (! $methodType || ! Request::isMethod($methodType)) {
512
+        if (!$methodType || !Request::isMethod($methodType)) {
513 513
             $result['api_status'] = 0;
514 514
             $result['api_message'] = "The request method is not allowed !";
515 515
 
@@ -547,7 +547,7 @@  discard block
 block discarded – undo
547 547
      */
548 548
     private function checkApiDefined($row_api, $result, $debugModeMessage, $posts)
549 549
     {
550
-        if (! $row_api) {
550
+        if (!$row_api) {
551 551
             $result['api_status'] = 0;
552 552
             $result['api_message'] = 'Sorry this API is no longer available, maybe has changed by admin, or please make sure api url is correct.';
553 553
 
@@ -617,11 +617,11 @@  discard block
 block discarded – undo
617 617
                     $value = $param['config'];
618 618
                 }
619 619
 
620
-                if ($required && $type == 'password' && ! Hash::check($value, $row->{$name})) {
620
+                if ($required && $type == 'password' && !Hash::check($value, $row->{$name})) {
621 621
                     $this->passwordError($result, $debugModeMessage, $posts);
622 622
                 }
623 623
 
624
-                if (! $required && $used && $value && ! Hash::check($value, $row->{$name})) {
624
+                if (!$required && $used && $value && !Hash::check($value, $row->{$name})) {
625 625
                     $this->passwordError($result, $debugModeMessage, $posts);
626 626
                 }
627 627
             }
Please login to merge, or discard this patch.
src/helpers/DbInspector.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -16,7 +16,7 @@  discard block
 block discarded – undo
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
 block discarded – undo
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
         $primaryKey = self::findPKname($table);
33 33
 
34
-        if (! $primaryKey) {
34
+        if (!$primaryKey) {
35 35
             return 'id';
36 36
         }
37 37
         CbCache::put('table_'.$table, 'primaryKey', $primaryKey);
@@ -101,7 +101,7 @@  discard block
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
142 142
         }
143 143
 
144 144
         $table = self::getTableForeignKey($fieldName);
145
-        if (! $table) {
145
+        if (!$table) {
146 146
             return false;
147 147
         }
148 148
 
Please login to merge, or discard this patch.