Passed
Pull Request — master (#1095)
by Iman
03:10
created
src/helpers/Helper.php 1 patch
Spacing   +26 added lines, -26 removed lines patch added patch discarded remove patch
@@ -8,28 +8,28 @@  discard block
 block discarded – undo
8 8
 | ---------------------------------------------------------------------------------------------------------------
9 9
 |
10 10
 */
11
-if (! function_exists('cbModulesNS')) {
11
+if (!function_exists('cbModulesNS')) {
12 12
     function cbModulesNS($path = '')
13 13
     {
14 14
         return '\crocodicstudio\crudbooster\Modules\\'.$path;
15 15
     }
16 16
 }
17 17
 
18
-if (! function_exists('cbAdminPath')) {
18
+if (!function_exists('cbAdminPath')) {
19 19
     function cbAdminPath()
20 20
     {
21 21
         return cbConfig('ADMIN_PATH');
22 22
     }
23 23
 }
24 24
 
25
-if (! function_exists('ctrlNamespace')) {
25
+if (!function_exists('ctrlNamespace')) {
26 26
     function ctrlNamespace()
27 27
     {
28 28
         return 'App\Http\Controllers';
29 29
     }
30 30
 }
31 31
 
32
-if (! function_exists('is_checked')) {
32
+if (!function_exists('is_checked')) {
33 33
     /**
34 34
      * @param $format
35 35
      * @param $value
@@ -53,7 +53,7 @@  discard block
 block discarded – undo
53 53
     }
54 54
 }
55 55
 
56
-if (! function_exists('controllers_dir')) {
56
+if (!function_exists('controllers_dir')) {
57 57
     function controllers_dir()
58 58
     {
59 59
         $_ = DIRECTORY_SEPARATOR;
@@ -61,7 +61,7 @@  discard block
 block discarded – undo
61 61
     }
62 62
 }
63 63
 
64
-if (! function_exists('controller_path')) {
64
+if (!function_exists('controller_path')) {
65 65
     function controller_path($controller)
66 66
     {
67 67
         $_ = DIRECTORY_SEPARATOR;
@@ -69,10 +69,10 @@  discard block
 block discarded – undo
69 69
     }
70 70
 }
71 71
 
72
-if (! function_exists('rrmdir')) {
72
+if (!function_exists('rrmdir')) {
73 73
     function rrmdir($dir)
74 74
     {
75
-        if (! is_dir($dir)) {
75
+        if (!is_dir($dir)) {
76 76
             return;
77 77
         }
78 78
         $objects = scandir($dir);
@@ -93,7 +93,7 @@  discard block
 block discarded – undo
93 93
     }
94 94
 }
95 95
 
96
-if (! function_exists('extract_unit')) {
96
+if (!function_exists('extract_unit')) {
97 97
     /*
98 98
     Credits: Bit Repository
99 99
     URL: http://www.bitrepository.com/extract-content-between-two-delimiters-with-php.html
@@ -111,7 +111,7 @@  discard block
 block discarded – undo
111 111
     }
112 112
 }
113 113
 
114
-if (! function_exists('now')) {
114
+if (!function_exists('now')) {
115 115
     function now()
116 116
     {
117 117
         return date('Y-m-d H:i:s');
@@ -125,17 +125,17 @@  discard block
 block discarded – undo
125 125
 | $name = name of input
126 126
 |
127 127
 */
128
-if (! function_exists('g')) {
128
+if (!function_exists('g')) {
129 129
     function g($name)
130 130
     {
131 131
         return Request::get($name);
132 132
     }
133 133
 }
134 134
 
135
-if (! function_exists('min_var_export')) {
135
+if (!function_exists('min_var_export')) {
136 136
     function min_var_export($input, $indent = "")
137 137
     {
138
-        if (! is_array($input)) {
138
+        if (!is_array($input)) {
139 139
             return var_export($input, true);
140 140
         }
141 141
         $buffer = [];
@@ -150,13 +150,13 @@  discard block
 block discarded – undo
150 150
     }
151 151
 }
152 152
 
153
-if (! function_exists('rrmdir')) {
153
+if (!function_exists('rrmdir')) {
154 154
     /*
155 155
     * http://stackoverflow.com/questions/3338123/how-do-i-recursively-delete-a-directory-and-its-entire-contents-files-sub-dir
156 156
     */
157 157
     function rrmdir($dir)
158 158
     {
159
-        if (! is_dir($dir)) {
159
+        if (!is_dir($dir)) {
160 160
             return;
161 161
         }
162 162
         foreach (scandir($dir) as $object) {
@@ -173,41 +173,41 @@  discard block
 block discarded – undo
173 173
     }
174 174
 }
175 175
 
176
-if (! function_exists('cbTrans')) {
176
+if (!function_exists('cbTrans')) {
177 177
     function cbTrans($key, $params = [])
178 178
     {
179 179
         return trans('crudbooster.'.$key, $params);
180 180
     }
181 181
 }
182 182
 
183
-if (! function_exists('cbAsset')) {
183
+if (!function_exists('cbAsset')) {
184 184
     function cbAsset($key)
185 185
     {
186 186
         return asset('vendor/crudbooster/assets/'.$key);
187 187
     }
188 188
 }
189 189
 
190
-if (! function_exists('cbScript')) {
190
+if (!function_exists('cbScript')) {
191 191
     function cbScript($key)
192 192
     {
193 193
         return '<script src="'.cbAsset($key).'" type="text/javascript"></script>';
194 194
     }
195 195
 }
196 196
 
197
-if (! function_exists('cbStyleSheet')) {
197
+if (!function_exists('cbStyleSheet')) {
198 198
     function cbStyleSheet($key)
199 199
     {
200 200
         return '<link rel="stylesheet" type="text/css" href="'.cbAsset($key).'"/>';
201 201
     }
202 202
 }
203 203
 
204
-if (! function_exists('cbConfig')) {
204
+if (!function_exists('cbConfig')) {
205 205
     function cbConfig($key, $default = null)
206 206
     {
207 207
         return config('crudbooster.'.$key, $default);
208 208
     }
209 209
 }
210
-if (! function_exists('makeValidationForHTML')) {
210
+if (!function_exists('makeValidationForHTML')) {
211 211
     function makeValidationForHTML($rules)
212 212
     {
213 213
         $validation = [];
@@ -225,7 +225,7 @@  discard block
 block discarded – undo
225 225
     }
226 226
 }
227 227
 
228
-if (! function_exists('findSelected')) {
228
+if (!function_exists('findSelected')) {
229 229
     /**
230 230
      * @param $rawvalue
231 231
      * @param $form
@@ -234,7 +234,7 @@  discard block
 block discarded – undo
234 234
      */
235 235
     function findSelected($rawvalue, $form, $optionValue)
236 236
     {
237
-        if (! $rawvalue) {
237
+        if (!$rawvalue) {
238 238
             return '';
239 239
         }
240 240
         $value = $rawvalue;
@@ -256,7 +256,7 @@  discard block
 block discarded – undo
256 256
         return $selected;
257 257
     }
258 258
 }
259
-if (! function_exists('array_get_keys')) {
259
+if (!function_exists('array_get_keys')) {
260 260
 
261 261
     /**
262 262
      * @param array $_array
@@ -272,14 +272,14 @@  discard block
 block discarded – undo
272 272
     }
273 273
 }
274 274
 
275
-if (! function_exists('cbGetSetting')) {
275
+if (!function_exists('cbGetSetting')) {
276 276
     function cbGetSetting($name)
277 277
     {
278 278
         return \crocodicstudio\crudbooster\Modules\SettingModule\SettingRepo::getSetting($name);
279 279
     }
280 280
 }
281 281
 
282
-if (! function_exists('backWithMsg')) {
282
+if (!function_exists('backWithMsg')) {
283 283
     function backWithMsg($msg, $type = 'success')
284 284
     {
285 285
         sendAndTerminate(redirect()->back()->with(['message_type' => $type, 'message' => $msg]));
Please login to merge, or discard this patch.
src/helpers/GetCurrentX.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -65,7 +65,7 @@
 block discarded – undo
65 65
 
66 66
     private static function getModulePath()
67 67
     {
68
-        $adminPathSegments = count(explode('/',config('crudbooster.ADMIN_PATH')));
68
+        $adminPathSegments = count(explode('/', config('crudbooster.ADMIN_PATH')));
69 69
         return Request::segment(1 + $adminPathSegments);
70 70
     }
71 71
 }
72 72
\ No newline at end of file
Please login to merge, or discard this patch.
src/commands/CrudboosterInstallationCommand.php 3 patches
Braces   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -55,7 +55,7 @@
 block discarded – undo
55 55
 
56 56
 		if($this->confirm('Do you have setting the database configuration at .env ?')) {
57 57
             $this->installCrudbooster();
58
-		}else{
58
+		} else{
59 59
 			$this->info('Setup Aborted !');
60 60
 			$this->info('Please setting the database configuration for first !');
61 61
 		}
Please login to merge, or discard this patch.
Indentation   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -59,19 +59,19 @@
 block discarded – undo
59 59
         $this->symlinkForAsset();
60 60
       
61 61
 
62
-		if($this->confirm('Do you have setting the database configuration at .env ?')) {
62
+        if($this->confirm('Do you have setting the database configuration at .env ?')) {
63 63
             $this->installCrudbooster();
64
-		}else{
65
-			$this->info('Setup Aborted !');
66
-			$this->info('Please setting the database configuration for first !');
67
-		}
64
+        }else{
65
+            $this->info('Setup Aborted !');
66
+            $this->info('Please setting the database configuration for first !');
67
+        }
68 68
 
69
-		$this->printFooter();
69
+        $this->printFooter();
70 70
         exit;
71
-	}
71
+    }
72 72
 
73
-	private function printHeader() {
74
-		$this->info("
73
+    private function printHeader() {
74
+        $this->info("
75 75
 
76 76
 #     __________  __  ______  ____                   __           
77 77
 #    / ____/ __ \/ / / / __ \/ __ )____  ____  _____/ /____  _____
Please login to merge, or discard this patch.
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -38,7 +38,7 @@  discard block
 block discarded – undo
38 38
         $this->printHeader();
39 39
 
40 40
         $passes = (new RequirementChecker())->check();
41
-        if(!$passes) {
41
+        if (!$passes) {
42 42
             $this->info('Sorry unfortunately your system is not meet with our requirements !');
43 43
             $this->printFooter(false);
44 44
             $this->info('--');
@@ -59,9 +59,9 @@  discard block
 block discarded – undo
59 59
         $this->symlinkForAsset();
60 60
       
61 61
 
62
-		if($this->confirm('Do you have setting the database configuration at .env ?')) {
62
+		if ($this->confirm('Do you have setting the database configuration at .env ?')) {
63 63
             $this->installCrudbooster();
64
-		}else{
64
+		} else {
65 65
 			$this->info('Setup Aborted !');
66 66
 			$this->info('Please setting the database configuration for first !');
67 67
 		}
@@ -139,7 +139,7 @@  discard block
 block discarded – undo
139 139
         if (!file_exists($vendorPath)) {
140 140
             $this->info('Creating public/vendor/crudbooster symlink...');
141 141
             app('files')->link(__DIR__.'/../assets', public_path('vendor/crudbooster'));
142
-            return ;
142
+            return;
143 143
         }
144 144
 
145 145
         $this->info('Vendor Path: '.$vendorPath);
@@ -175,7 +175,7 @@  discard block
 block discarded – undo
175 175
         $this->info('Migrating database...');
176 176
         $this->call('migrate', ['--path'=> '\database\migrations\crudbooster']);
177 177
 
178
-        if (! class_exists('CBSeeder')) {
178
+        if (!class_exists('CBSeeder')) {
179 179
             require_once __DIR__.'/../database/seeds/CBSeeder.php';
180 180
         }
181 181
         $this->callSilent('db:seed', ['--class' => 'CBSeeder']);
@@ -188,11 +188,11 @@  discard block
 block discarded – undo
188 188
     private function createVendorAtPublic()
189 189
     {
190 190
         $this->info('Checking public/vendor directory...');
191
-        if (! file_exists(public_path('vendor'))) {
191
+        if (!file_exists(public_path('vendor'))) {
192 192
             mkdir(public_path('vendor'), 0777);
193 193
         }
194 194
 
195
-        if (! is_writable(public_path('vendor'))) {
195
+        if (!is_writable(public_path('vendor'))) {
196 196
             $this->info('Setup aborted !');
197 197
             $this->info('Please set public/vendor directory to writable 0777');
198 198
             exit;
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
@@ -11,7 +11,7 @@  discard block
 block discarded – undo
11 11
         $datatableWhere = urldecode(request('datatable_where'));
12 12
         $foreign_key_name = request('fk_name');
13 13
         $foreign_key_value = request('fk_value');
14
-        if (! $table || ! $label || ! $foreign_key_name || ! $foreign_key_value) {
14
+        if (!$table || !$label || !$foreign_key_name || !$foreign_key_value) {
15 15
             return response()->json([]);
16 16
         }
17 17
         $query = DB::table($table);
@@ -33,7 +33,7 @@  discard block
 block discarded – undo
33 33
 
34 34
         $result = DB::table($data['table']);
35 35
         if (request('q')) {
36
-            $result->where(function ($where) use ($columns) {
36
+            $result->where(function($where) use ($columns) {
37 37
                 foreach ($columns as $c => $col) {
38 38
                     if ($c == 0) {
39 39
                         $where->where($col, 'like', '%'.request('q').'%');
@@ -61,7 +61,7 @@  discard block
 block discarded – undo
61 61
     public function getDataQuery()
62 62
     {
63 63
         $key = request('query');
64
-        if (! Cache::has($key)) {
64
+        if (!Cache::has($key)) {
65 65
             return response()->json(['items' => []]);
66 66
         }
67 67
         $query = Cache::get($key);
Please login to merge, or discard this patch.
src/controllers/CBController.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -84,7 +84,7 @@  discard block
 block discarded – undo
84 84
 
85 85
     private function checkHideForm()
86 86
     {
87
-        if (! count($this->hide_form)) {
87
+        if (!count($this->hide_form)) {
88 88
             return null;
89 89
         }
90 90
         foreach ($this->form as $i => $f) {
@@ -152,7 +152,7 @@  discard block
 block discarded – undo
152 152
             $type = $ro['type'] ?: 'text';
153 153
             $inputdata = request($name);
154 154
 
155
-            if (! $name || $ro['exception']) {
155
+            if (!$name || $ro['exception']) {
156 156
                 continue;
157 157
             }
158 158
 
Please login to merge, or discard this patch.
src/controllers/CBController/ExportData.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -19,7 +19,7 @@
 block discarded – undo
19 19
             $this->table('cms_settings')->where('name', 'default_paper_size')->update(['content' => $papersize]);
20 20
         }
21 21
         $format = request('fileformat');
22
-        if(in_array($format, ['pdf', 'xls', 'csv']))
22
+        if (in_array($format, ['pdf', 'xls', 'csv']))
23 23
         {
24 24
             return app(IndexExport::class)->{$format}($filename, $indexContent, $paperorientation, $papersize);
25 25
         }
Please login to merge, or discard this patch.
src/controllers/CBController/ImportData.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -17,12 +17,12 @@
 block discarded – undo
17 17
         $data['page_menu'] = Route::getCurrentRoute()->getActionName();
18 18
         $data['page_title'] = 'Import Data '.CB::getCurrentModule()->name;
19 19
 
20
-        if (! request('file') || request('import')) {
20
+        if (!request('file') || request('import')) {
21 21
             return $this->cbView('crudbooster::import', $data);
22 22
         }
23 23
 
24 24
         $file = 'storage'.DIRECTORY_SEPARATOR.'app'.DIRECTORY_SEPARATOR.base64_decode(request('file'));
25
-        $rows = Excel::load($file, function ($reader) {
25
+        $rows = Excel::load($file, function($reader) {
26 26
         })->get();
27 27
 
28 28
         session()->put('total_data_import', count($rows));
Please login to merge, or discard this patch.
src/commands/RequirementChecker.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
      */
64 64
     private function chechExtension($extension)
65 65
     {
66
-        if (! extension_loaded($extension)) {
66
+        if (!extension_loaded($extension)) {
67 67
             $this->info($extension.' extension: [Bad]');
68 68
             return $this->requirements = false;
69 69
         }
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
@@ -22,7 +22,7 @@
 block discarded – undo
22 22
     function handle($result, $table)
23 23
     {
24 24
         $orderby = $this->ctrl->orderby;
25
-        if (! $orderby) {
25
+        if (!$orderby) {
26 26
             $result->orderby($table.'.'.$this->ctrl->primary_key, 'desc');
27 27
             return;
28 28
         }
Please login to merge, or discard this patch.