Passed
Pull Request — master (#1128)
by Iman
06:09 queued 02:06
created
src/Modules/ModuleGenerator/Step3Handler.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -8,7 +8,7 @@
 block discarded – undo
8 8
 {
9 9
     public function showForm($id)
10 10
     {
11
-        $row = ModulesRepo::find($id);;
11
+        $row = ModulesRepo::find($id); ;
12 12
 
13 13
         $columns = DbInspector::getTableCols($row->table_name);
14 14
 
Please login to merge, or discard this patch.
src/CBCoreModule/RouteController.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -63,7 +63,7 @@
 block discarded – undo
63 63
     private static function getControllerMethods($ctrl)
64 64
     {
65 65
         $controller_methods = (new \ReflectionClass($ctrl))->getMethods(\ReflectionMethod::IS_PUBLIC);
66
-        $controller_methods = array_filter($controller_methods, function ($method) {
66
+        $controller_methods = array_filter($controller_methods, function($method) {
67 67
             return ($method->class !== 'Illuminate\Routing\Controller' && $method->name !== 'getIndex');
68 68
         });
69 69
 
Please login to merge, or discard this patch.
src/controllers/CBController/IndexAjax.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -15,7 +15,7 @@  discard block
 block discarded – undo
15 15
         $datatableWhere = urldecode(request('datatable_where'));
16 16
         $foreignKeyName = request('fk_name');
17 17
         $foreignKeyValue = request('fk_value');
18
-        if (! $table || ! $label || ! $foreignKeyName || ! $foreignKeyValue) {
18
+        if (!$table || !$label || !$foreignKeyName || !$foreignKeyValue) {
19 19
             return response()->json([]);
20 20
         }
21 21
         $query = DB::table($table);
@@ -51,7 +51,7 @@  discard block
 block discarded – undo
51 51
     public function getDataQuery()
52 52
     {
53 53
         $key = request('query');
54
-        if (! Cache::has($key)) {
54
+        if (!Cache::has($key)) {
55 55
             return response()->json(['items' => []]);
56 56
         }
57 57
         $query = Cache::get($key);
@@ -93,7 +93,7 @@  discard block
 block discarded – undo
93 93
         if (request('q')) {
94 94
             return;
95 95
         }
96
-        $result->where(function ($where) use ($columns) {
96
+        $result->where(function($where) use ($columns) {
97 97
             foreach ($columns as $c => $col) {
98 98
                 if ($c == 0) {
99 99
                     $where->where($col, 'like', '%'.request('q').'%');
Please login to merge, or discard this patch.
src/controllers/ApiController.php 1 patch
Indentation   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -74,7 +74,7 @@
 block discarded – undo
74 74
      * @param $name
75 75
      * @return mixed
76 76
      */
77
-   /* private function handleBase64($value, $uploads_format_candidate, $row_assign, $name)
77
+    /* private function handleBase64($value, $uploads_format_candidate, $row_assign, $name)
78 78
     {
79 79
         $filedata = base64_decode($value);
80 80
         $f = finfo_open();
Please login to merge, or discard this patch.
src/controllers/ApiController/ExecuteApi.php 1 patch
Spacing   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -226,7 +226,7 @@  discard block
 block discarded – undo
226 226
      */
227 227
     private function filterRows($data, $parameters, $posts, $table, $type_except)
228 228
     {
229
-        $data->where(function ($w) use ($parameters, $posts, $table, $type_except) {
229
+        $data->where(function($w) use ($parameters, $posts, $table, $type_except) {
230 230
             foreach ($parameters as $param) {
231 231
                 $name = $param['name'];
232 232
                 $type = $param['type'];
@@ -318,7 +318,7 @@  discard block
 block discarded – undo
318 318
                     $row->$k = asset($v);
319 319
                 }
320 320
 
321
-                if (! in_array($k, $responses_fields)) {
321
+                if (!in_array($k, $responses_fields)) {
322 322
                     unset($row[$k]);
323 323
                 }
324 324
             }
@@ -381,7 +381,7 @@  discard block
 block discarded – undo
381 381
                 $rows->$k = asset($v);
382 382
             }
383 383
 
384
-            if (! in_array($k, $responses_fields)) {
384
+            if (!in_array($k, $responses_fields)) {
385 385
                 unset($row[$k]);
386 386
             }
387 387
         }
@@ -403,7 +403,7 @@  discard block
 block discarded – undo
403 403
             $subquery = $resp['subquery'];
404 404
             $used = intval($resp['used']);
405 405
 
406
-            if ($used == 0 && ! DbInspector::isForeignKey($name)) {
406
+            if ($used == 0 && !DbInspector::isForeignKey($name)) {
407 407
                 continue;
408 408
             }
409 409
 
@@ -458,7 +458,7 @@  discard block
 block discarded – undo
458 458
      */
459 459
     private function applyLike($data, $search_in, $value)
460 460
     {
461
-        $data->where(function ($w) use ($search_in, $value) {
461
+        $data->where(function($w) use ($search_in, $value) {
462 462
             foreach ($search_in as $k => $field) {
463 463
                 if ($k == 0) {
464 464
                     $w->where($field, "like", "%$value%");
@@ -506,7 +506,7 @@  discard block
 block discarded – undo
506 506
     private function validateMethodType($row_api, $result, $debugModeMessage, $posts)
507 507
     {
508 508
         $method_type = $row_api->method_type;
509
-        if (! $method_type || ! Request::isMethod($method_type)) {
509
+        if (!$method_type || !Request::isMethod($method_type)) {
510 510
             $result['api_status'] = 0;
511 511
             $result['api_message'] = "The request method is not allowed !";
512 512
 
@@ -544,7 +544,7 @@  discard block
 block discarded – undo
544 544
      */
545 545
     private function checkApiDefined($row_api, $result, $debugModeMessage, $posts)
546 546
     {
547
-        if (! $row_api) {
547
+        if (!$row_api) {
548 548
             $result['api_status'] = 0;
549 549
             $result['api_message'] = 'Sorry this API is no longer available, maybe has changed by admin, or please make sure api url is correct.';
550 550
 
@@ -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
                 }
Please login to merge, or discard this patch.
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'] = CB::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/Modules/ModuleGenerator/ScaffoldingParser.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -9,10 +9,10 @@  discard block
 block discarded – undo
9 9
         $colsItem = self::extractLines($code, $type);
10 10
 
11 11
         foreach ($colsItem as &$item) {
12
-            $item = str_replace(' ','', $item);
12
+            $item = str_replace(' ', '', $item);
13 13
             // "['label'=>'KanapeType','name'=>'kanape_type',];\r\n"
14 14
 
15
-            $item = str_replace('\',]',']', $item); // replaces:  ',]  with   ]
15
+            $item = str_replace('\',]', ']', $item); // replaces:  ',]  with   ]
16 16
             // "['label'=>'KanapeType','name'=>'kanape_type];\r\n"
17 17
 
18 18
             $item = trim($item);
@@ -131,7 +131,7 @@  discard block
 block discarded – undo
131 131
             } elseif (strpos($s, 'callback') !== false) {
132 132
                 $colInnerItem['callback'] = self::parseCallback($s);
133 133
             } else {
134
-                $s = str_replace("'", '',$s);
134
+                $s = str_replace("'", '', $s);
135 135
                 $sSplit = explode('=>', $s);
136 136
                 $colInnerItem[$sSplit[0]] = $sSplit[1];
137 137
             }
Please login to merge, or discard this patch.
src/Modules/ModuleGenerator/Step2Handler.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -62,7 +62,7 @@
 block discarded – undo
62 62
         $columnScript[] = str_repeat(' ', 12).'$this->col[] = [];';
63 63
         foreach ($labels as $i => $label) {
64 64
 
65
-            if (! $name[$i]) {
65
+            if (!$name[$i]) {
66 66
                 continue;
67 67
             }
68 68
 
Please login to merge, or discard this patch.
src/helpers/CRUDBooster.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -110,7 +110,7 @@  discard block
 block discarded – undo
110 110
     public static function first($table, $id)
111 111
     {
112 112
         $table = self::parseSqlTable($table)['table'];
113
-        if (! is_array($id)) {
113
+        if (!is_array($id)) {
114 114
             $pk = DbInspector::findPK($table);
115 115
 
116 116
             return DB::table($table)->where($pk, $id)->first();
@@ -143,7 +143,7 @@  discard block
 block discarded – undo
143 143
         $controllerName = basename($controllerName);
144 144
         $route_url = route($controllerName.'GetIndex');
145 145
 
146
-        if (! $path) {
146
+        if (!$path) {
147 147
             return trim($route_url, '/');
148 148
         }
149 149
 
@@ -171,11 +171,11 @@  discard block
 block discarded – undo
171 171
 
172 172
     public static function listCbTables()
173 173
     {
174
-        $tables = array_map(function ($table) {
174
+        $tables = array_map(function($table) {
175 175
             return $table->TABLE_NAME;
176 176
         }, DbInspector::listTables());
177 177
 
178
-        $filter = function ($tableName) {
178
+        $filter = function($tableName) {
179 179
 
180 180
             if ($tableName == config('database.migrations')) {
181 181
                 return false;
Please login to merge, or discard this patch.