Passed
Pull Request — master (#1135)
by Iman
05:17
created
src/routes.php 1 patch
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -4,7 +4,7 @@  discard block
 block discarded – undo
4 4
 
5 5
 $namespace = '\crocodicstudio\crudbooster\controllers';
6 6
 /* ROUTER FOR UPLOADS */
7
-Route::group(['middleware' => ['web'], 'namespace' => $namespace], function () {
7
+Route::group(['middleware' => ['web'], 'namespace' => $namespace], function() {
8 8
     Route::get('uploads/{one?}/{two?}/{three?}/{four?}/{five?}', ['uses' => 'FileController@getPreview', 'as' => 'fileControllerPreview']);
9 9
 });
10 10
 
@@ -13,7 +13,7 @@  discard block
 block discarded – undo
13 13
     'middleware' => ['web', CBBackend::class],
14 14
     'prefix' => cbAdminPath(),
15 15
     'namespace' => ctrlNamespace(),
16
-], function () {
16
+], function() {
17 17
     CRUDBooster::routeController('users', 'AdminUsersController');
18 18
     try {
19 19
         $modules = DB::table('cms_moduls')->where('path', '!=', '')->where('controller', '!=', '')->where('is_protected', 0)->get();
@@ -29,10 +29,10 @@  discard block
 block discarded – undo
29 29
     'middleware' => ['web', \crocodicstudio\crudbooster\middlewares\CBSuperadmin::class],
30 30
     'prefix' => cbAdminPath(),
31 31
     'namespace' => $namespace,
32
-], function () {
33
-    Route::post('{module}/do-upload-import-data', ['uses' => 'FileController@uploadImportData', 'as' => 'UploadImportData',]);
34
-    Route::post('{module}/upload-summernote', ['uses' => 'FileController@uploadSummernote', 'as' => 'UploadImportData',]);
35
-    Route::post('{module}/upload-file', ['uses' => 'FileController@uploadFile', 'as' => 'UploadImportData',]);
36
-    Route::post('{module}/done-import', ['uses' => 'FileController@doneImport', 'as' => 'doneImportData',]);
32
+], function() {
33
+    Route::post('{module}/do-upload-import-data', ['uses' => 'FileController@uploadImportData', 'as' => 'UploadImportData', ]);
34
+    Route::post('{module}/upload-summernote', ['uses' => 'FileController@uploadSummernote', 'as' => 'UploadImportData', ]);
35
+    Route::post('{module}/upload-file', ['uses' => 'FileController@uploadFile', 'as' => 'UploadImportData', ]);
36
+    Route::post('{module}/done-import', ['uses' => 'FileController@doneImport', 'as' => 'doneImportData', ]);
37 37
 });
38 38
 
Please login to merge, or discard this patch.
src/Modules/AuthModule/AuthController.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -30,7 +30,7 @@  discard block
 block discarded – undo
30 30
 
31 31
     public function getLockscreen()
32 32
     {
33
-        if (! CRUDBooster::myId()) {
33
+        if (!CRUDBooster::myId()) {
34 34
             Session::flush();
35 35
             return redirect()->route('getLogin')->with('message', cbTrans('alert_session_expired'));
36 36
         }
@@ -96,7 +96,7 @@  discard block
 block discarded – undo
96 96
 
97 97
     private function validateForgotPass()
98 98
     {
99
-        $validator = Validator::make(request()->all(), ['email' => 'required|email|exists:cms_users',]);
99
+        $validator = Validator::make(request()->all(), ['email' => 'required|email|exists:cms_users', ]);
100 100
 
101 101
         if ($validator->fails()) {
102 102
             $message = $validator->errors()->all();
Please login to merge, or discard this patch.
src/Modules/AuthModule/LoginController.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -69,7 +69,7 @@
 block discarded – undo
69 69
      */
70 70
     private function validatePassword($password, $users)
71 71
     {
72
-        if (! \Hash::check($password, $users->password)) {
72
+        if (!\Hash::check($password, $users->password)) {
73 73
             $resp = redirect()->route('getLogin')->with('message', cbTrans('alert_password_wrong'));
74 74
             sendAndTerminate($resp);
75 75
         }
Please login to merge, or discard this patch.
src/controllers/CBController/CbFormLoader.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -83,7 +83,7 @@
 block discarded – undo
83 83
 
84 84
     private function checkHideForm()
85 85
     {
86
-        if (! count($this->hide_form)) {
86
+        if (!count($this->hide_form)) {
87 87
             return null;
88 88
         }
89 89
         foreach ($this->form as $i => $f) {
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 = CRUDBooster::getTableForeignKey($fieldName);
145
-        if (! $table) {
145
+        if (!$table) {
146 146
             return false;
147 147
         }
148 148
 
Please login to merge, or discard this patch.
src/CBCoreModule/Index/Order.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -24,7 +24,7 @@
 block discarded – undo
24 24
     function handle($result, $table)
25 25
     {
26 26
         $orderby = $this->ctrl->orderby;
27
-        if (! $orderby) {
27
+        if (!$orderby) {
28 28
             $result->orderby($table.'.'.$this->ctrl->primaryKey, 'desc');
29 29
             return;
30 30
         }
Please login to merge, or discard this patch.
src/Modules/ModuleGenerator/AdminModulesController.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -16,7 +16,7 @@  discard block
 block discarded – undo
16 16
     {
17 17
         $this->table = 'cms_moduls';
18 18
         $this->primaryKey = 'id';
19
-        $this->title_field = 'name' ;
19
+        $this->title_field = 'name';
20 20
         $this->limit = 100;
21 21
         $this->button_add = false;
22 22
         $this->buttonExport = false;
@@ -28,7 +28,7 @@  discard block
 block discarded – undo
28 28
         $this->orderby = ['is_protected' => 'asc', 'name' => 'asc'];
29 29
 
30 30
         $this->col = [];
31
-        $this->col[] = ['label' => 'name', 'name' => 'name' ];
31
+        $this->col[] = ['label' => 'name', 'name' => 'name'];
32 32
         $this->col[] = ['label' => "Table", 'name' => "table_name"];
33 33
         $this->col[] = ['label' => "Path", 'name' => "path"];
34 34
         $this->col[] = ['label' => "Controller", 'name' => "controller"];
@@ -250,7 +250,7 @@  discard block
 block discarded – undo
250 250
         $this->form[] = ['label' => 'Controller', 'name' => 'controller', 'type' => 'text', 'placeholder' => '(Optional) Auto Generated'];
251 251
 
252 252
         if (in_array(CRUDBooster::getCurrentMethod(), ['getAdd', 'postAddSave'])) {
253
-            return ;
253
+            return;
254 254
         }
255 255
 
256 256
         $this->form[] = [
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
@@ -107,7 +107,7 @@  discard block
 block discarded – undo
107 107
             $data['parent_field'] = CRUDBooster::getTableForeignKey(request('parent_table'), $this->table);
108 108
         }
109 109
 
110
-        if (! $data['parent_field']) {
110
+        if (!$data['parent_field']) {
111 111
             return $data;
112 112
         }
113 113
 
@@ -125,7 +125,7 @@  discard block
 block discarded – undo
125 125
      */
126 126
     private function _filterForParent($result)
127 127
     {
128
-        if (! request('parent_id')) {
128
+        if (!request('parent_id')) {
129 129
             return null;
130 130
         }
131 131
 
@@ -139,7 +139,7 @@  discard block
 block discarded – undo
139 139
      */
140 140
     private function _filterOutSoftDeleted($tableColumns, $result)
141 141
     {
142
-        if (! in_array('deleted_at', $tableColumns)) {
142
+        if (!in_array('deleted_at', $tableColumns)) {
143 143
             return;
144 144
         }
145 145
         $result->where($this->table.'.deleted_at', '=', null);
@@ -198,9 +198,9 @@  discard block
 block discarded – undo
198 198
     private function _applyWhereAndQfilters($result, $columnsTable, $table)
199 199
     {
200 200
         if (request('q')) {
201
-            $result->where(function ($query) use ($columnsTable) {
201
+            $result->where(function($query) use ($columnsTable) {
202 202
                 foreach ($columnsTable as $col) {
203
-                    if (! $col['field_with']) {
203
+                    if (!$col['field_with']) {
204 204
                         continue;
205 205
                     }
206 206
                     $query->orwhere($col['field_with'], "like", "%".request("q")."%");
@@ -272,7 +272,7 @@  discard block
 block discarded – undo
272 272
         return CRUDBooster::adminPath($module['path']).'?parent_table='.$table_parent.'&parent_columns='
273 273
             .$module['parent_columns'].'&parent_columns_alias='
274 274
             .$module['parent_columns_alias'].'&parent_id=['
275
-            .(! isset($module['custom_parent_id']) ? "id" : $module['custom_parent_id'])
275
+            .(!isset($module['custom_parent_id']) ? "id" : $module['custom_parent_id'])
276 276
             .']&return_url='.urlencode(Request::fullUrl()).'&foreign_key='
277 277
             .$module['foreign_key'].'&label='.urlencode($module['label']);
278 278
     }
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 = CRUDBooster::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.