Passed
Pull Request — master (#1092)
by Iman
07:45 queued 01:54
created
src/helpers/DbInspector.php 1 patch
Spacing   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -15,7 +15,7 @@  discard block
 block discarded – undo
15 15
      */
16 16
     public static function findPK($table)
17 17
     {
18
-        if (! $table) {
18
+        if (!$table) {
19 19
             return 'id';
20 20
         }
21 21
 
@@ -24,13 +24,13 @@  discard block
 block discarded – undo
24 24
         }
25 25
         $table = CRUDBooster::parseSqlTable($table);
26 26
 
27
-        if (! $table['table']) {
27
+        if (!$table['table']) {
28 28
             throw new \Exception("parseSqlTable can't determine the table");
29 29
         }
30 30
 
31 31
         $primary_key = self::findPKname($table);
32 32
 
33
-        if (! $primary_key) {
33
+        if (!$primary_key) {
34 34
             return 'id';
35 35
         }
36 36
         CRUDBooster::putCache('table_'.$table, 'primary_key', $primary_key);
@@ -100,7 +100,7 @@  discard block
 block discarded – undo
100 100
         $cols = collect(DB::select('SELECT * FROM information_schema.COLUMNS WHERE TABLE_SCHEMA = :database AND TABLE_NAME = :table', [
101 101
             'database' => $table['database'],
102 102
             'table' => $table['table'],
103
-        ]))->map(function ($x) {
103
+        ]))->map(function($x) {
104 104
             return (array) $x;
105 105
         })->toArray();
106 106
 
@@ -114,10 +114,10 @@  discard block
 block discarded – undo
114 114
      */
115 115
     public static function colExists($table, $field)
116 116
     {
117
-        if (! $table) {
117
+        if (!$table) {
118 118
             throw new Exception("\$table is empty !", 1);
119 119
         }
120
-        if (! $field) {
120
+        if (!$field) {
121 121
             throw new Exception("\$field is empty !", 1);
122 122
         }
123 123
 
@@ -153,7 +153,7 @@  discard block
 block discarded – undo
153 153
     {
154 154
         $field = 'field_type_'.$table.'_'.$field;
155 155
 
156
-        return Cache::rememberForever($field, function () use ($table, $field) {
156
+        return Cache::rememberForever($field, function() use ($table, $field) {
157 157
             try {
158 158
                 //MySQL & SQL Server
159 159
                 $typedata = DB::select(DB::raw("select DATA_TYPE from INFORMATION_SCHEMA.COLUMNS where TABLE_NAME='$table' and COLUMN_NAME = '$field'"))[0]->DATA_TYPE;
@@ -178,7 +178,7 @@  discard block
 block discarded – undo
178 178
         }
179 179
 
180 180
         $table = CRUDBooster::getTableForeignKey($fieldName);
181
-        if (! $table) {
181
+        if (!$table) {
182 182
             return false;
183 183
         }
184 184
 
Please login to merge, or discard this patch.
src/helpers/Cache.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -8,7 +8,7 @@  discard block
 block discarded – undo
8 8
 {
9 9
     public static function get($section, $cacheName)
10 10
     {
11
-        if (! CacheFacade::has($section)) {
11
+        if (!CacheFacade::has($section)) {
12 12
             return false;
13 13
         }
14 14
         $cacheOpen = CacheFacade::get($section);
@@ -32,7 +32,7 @@  discard block
 block discarded – undo
32 32
 
33 33
     public static function forgetCache($section, $cache_name)
34 34
     {
35
-        if (! CacheFacade::has($section)) {
35
+        if (!CacheFacade::has($section)) {
36 36
             return false;
37 37
         }
38 38
         $open = CacheFacade::get($section);
Please login to merge, or discard this patch.
src/helpers/Parsers/ScaffoldingParser.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -9,8 +9,8 @@  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);
13
-            $item = str_replace('\',]',']', $item);
12
+            $item = str_replace(' ', '', $item);
13
+            $item = str_replace('\',]', ']', $item);
14 14
             $item = trim($item);
15 15
             $item = trim($item, '[');
16 16
             $item = trim($item, '];');
@@ -42,7 +42,7 @@  discard block
 block discarded – undo
42 42
                     $val = trim(str_replace("'options'=>", "", $s));
43 43
                 } elseif (strpos($s, 'callback')) {
44 44
                     $key = 'callback';
45
-                    $s = str_replace("return","return ",$s);
45
+                    $s = str_replace("return", "return ", $s);
46 46
                     $val = trim(str_replace(["'callback'=>function(\$row) {", "'callback'=>function(\$row){"], "", $s));
47 47
                     $val = substr($val, 0, -1); //to remove last }
48 48
                 } else {
Please login to merge, or discard this patch.
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/CrudboosterUpdateCommand.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -44,11 +44,11 @@  discard block
 block discarded – undo
44 44
 
45 45
         //Create vendor folder at public
46 46
         $this->info('Checking public/vendor directory...');
47
-        if (! file_exists(public_path('vendor'))) {
47
+        if (!file_exists(public_path('vendor'))) {
48 48
             $this->info('Creating public/vendor directory...');
49 49
             mkdir(public_path('vendor'), 0777);
50 50
         } else {
51
-            if (! is_writable(public_path('vendor'))) {
51
+            if (!is_writable(public_path('vendor'))) {
52 52
                 $this->info('Setup aborted !');
53 53
                 $this->info('Please set public/vendor directory to writable 0777');
54 54
 
@@ -103,7 +103,7 @@  discard block
 block discarded – undo
103 103
         $this->info('Migrating database...');
104 104
         $this->call('migrate');
105 105
 
106
-        if (! class_exists('CBSeeder')) {
106
+        if (!class_exists('CBSeeder')) {
107 107
             require_once __DIR__.'/../database/seeds/CBSeeder.php';
108 108
         }
109 109
         $this->callSilent('db:seed', ['--class' => 'CBSeeder']);
Please login to merge, or discard this patch.
src/commands/CrudboosterInstallationCommand.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -53,9 +53,9 @@  discard block
 block discarded – undo
53 53
         $this->symlinkForAsset();
54 54
       
55 55
 
56
-		if($this->confirm('Do you have setting the database configuration at .env ?')) {
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
 		}
@@ -212,7 +212,7 @@  discard block
 block discarded – undo
212 212
         if (!file_exists(public_path('vendor'.DIRECTORY_SEPARATOR.'crudbooster'))) {
213 213
             $this->info('Creating public/vendor/crudbooster symlink...');
214 214
             app('files')->link(__DIR__.'/../assets', public_path('vendor/crudbooster'));
215
-            return ;
215
+            return;
216 216
         }
217 217
         $vendorpath = public_path('vendor'.DIRECTORY_SEPARATOR.'crudbooster');
218 218
 
@@ -251,7 +251,7 @@  discard block
 block discarded – undo
251 251
         $this->info('Migrating database...');
252 252
         $this->call('migrate', ['--path'=> '\database\migrations\crudbooster']);
253 253
 
254
-        if (! class_exists('CBSeeder')) {
254
+        if (!class_exists('CBSeeder')) {
255 255
             require_once __DIR__.'/../database/seeds/CBSeeder.php';
256 256
         }
257 257
         $this->callSilent('db:seed', ['--class' => 'CBSeeder']);
@@ -264,11 +264,11 @@  discard block
 block discarded – undo
264 264
     private function createVendorAtPublic()
265 265
     {
266 266
         $this->info('Checking public/vendor directory...');
267
-        if (! file_exists(public_path('vendor'))) {
267
+        if (!file_exists(public_path('vendor'))) {
268 268
             mkdir(public_path('vendor'), 0777);
269 269
         }
270 270
 
271
-        if (! is_writable(public_path('vendor'))) {
271
+        if (!is_writable(public_path('vendor'))) {
272 272
             $this->info('Setup aborted !');
273 273
             $this->info('Please set public/vendor directory to writable 0777');
274 274
 
Please login to merge, or discard this patch.
src/localization/ar/crudbooster.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -202,8 +202,8 @@
 block discarded – undo
202 202
     'datamodal_select'=>'Select',
203 203
     'datamodal_search_and_enter'=>'Search and enter...',
204 204
     'datamodal_enter_to_search'=>'Enter to search',
205
-    'datamodal_browse_data'=>'Browse Data' ,
206
-    'datamodal_browse_file'=>'Browse File' ,
205
+    'datamodal_browse_data'=>'Browse Data',
206
+    'datamodal_browse_file'=>'Browse File',
207 207
     
208 208
 
209 209
     //child 
Please login to merge, or discard this patch.
src/localization/id/crudbooster.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -202,8 +202,8 @@
 block discarded – undo
202 202
     'datamodal_select'=>'Select',
203 203
     'datamodal_search_and_enter'=>'Search and enter...',
204 204
     'datamodal_enter_to_search'=>'Enter to search',
205
-    'datamodal_browse_data'=>'Browse Data' ,
206
-    'datamodal_browse_file'=>'Browse File' ,
205
+    'datamodal_browse_data'=>'Browse Data',
206
+    'datamodal_browse_file'=>'Browse File',
207 207
     
208 208
 
209 209
     //child 
Please login to merge, or discard this patch.