Passed
Pull Request — master (#1132)
by Iman
04:36 queued 30s
created
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/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.
src/Modules/ModuleGenerator/ControllerGenerator/FormConfigGenerator.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -88,7 +88,7 @@  discard block
 block discarded – undo
88 88
 
89 89
             $props = array_get($map, FieldDetector::detect($colName), null);
90 90
             unset($map);
91
-            if($props !== null){
91
+            if ($props !== null) {
92 92
                 $input = array_merge($input, $props);
93 93
             }
94 94
 
@@ -128,8 +128,8 @@  discard block
 block discarded – undo
128 128
 
129 129
         $arr = array_get([
130 130
             'text' => ['textarea', "string|min:5", []],
131
-            'date' => ['date', "date", ['php_format' => 'M, d Y', 'datepicker_format' => 'M, dd YYYY',]],
132
-            'datetime' => ['datetime', "date_format:Y-m-d H:i:s", ['php_format' => 'M, d Y H:i',]],
131
+            'date' => ['date', "date", ['php_format' => 'M, d Y', 'datepicker_format' => 'M, dd YYYY', ]],
132
+            'datetime' => ['datetime', "date_format:Y-m-d H:i:s", ['php_format' => 'M, d Y H:i', ]],
133 133
             'time' => ['time', 'date_format:H:i:s', []],
134 134
             'double' => ['money', "integer|min:0", []],
135 135
             'int' => ['number', 'integer|min:0', []],
@@ -149,7 +149,7 @@  discard block
 block discarded – undo
149 149
     private static function handleForeignKey($field)
150 150
     {
151 151
         $jointable = str_replace(['id_', '_id'], '', $field);
152
-        if (! Schema::hasTable($jointable)) {
152
+        if (!Schema::hasTable($jointable)) {
153 153
             return ['', ''];
154 154
         }
155 155
         $options = [
Please login to merge, or discard this patch.
src/Modules/ModuleGenerator/ControllerGenerator/FieldDetector.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -43,7 +43,7 @@
 block discarded – undo
43 43
             'isNameField',
44 44
             'isUrlField',
45 45
         ];
46
-        foreach ($map as $methodName){
46
+        foreach ($map as $methodName) {
47 47
             if (self::$methodName($colName)) {
48 48
                 return $methodName;
49 49
             }
Please login to merge, or discard this patch.
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.