Passed
Push — master ( c52d76...a99d60 )
by Iman
09:00 queued 04:52
created
src/helpers/DbInspector.php 1 patch
Spacing   +6 added lines, -6 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
 
@@ -116,7 +116,7 @@  discard block
 block discarded – undo
116 116
     {
117 117
         $field = 'field_type_'.$table.'_'.$field;
118 118
 
119
-        return Cache::rememberForever($field, function () use ($table, $field) {
119
+        return Cache::rememberForever($field, function() use ($table, $field) {
120 120
             try {
121 121
                 //MySQL & SQL Server
122 122
                 $typedata = DB::select(DB::raw("select DATA_TYPE from INFORMATION_SCHEMA.COLUMNS where TABLE_NAME='$table' and COLUMN_NAME = '$field'"))[0]->DATA_TYPE;
@@ -141,7 +141,7 @@  discard block
 block discarded – undo
141 141
         }
142 142
 
143 143
         $table = CRUDBooster::getTableForeignKey($fieldName);
144
-        if (! $table) {
144
+        if (!$table) {
145 145
             return false;
146 146
         }
147 147
 
Please login to merge, or discard this patch.
src/controllers/CBController.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/controllers/CBController/FormSubmitHandlers.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -19,7 +19,7 @@  discard block
 block discarded – undo
19 19
             $type = $form['type'] ?: 'text';
20 20
             $inputdata = request($name);
21 21
 
22
-            if (! $name || in_array($name, $hide_form) || $form['exception']) {
22
+            if (!$name || in_array($name, $hide_form) || $form['exception']) {
23 23
                 continue;
24 24
             }
25 25
 
@@ -60,7 +60,7 @@  discard block
 block discarded – undo
60 60
         app(RelationHandler::class)->save($this->table, $id, $this->data_inputan);
61 61
         $this->hookAfterAdd($id);
62 62
 
63
-        $this->insertLog('log_add', $id. ' on ' . $this->table);
63
+        $this->insertLog('log_add', $id.' on '.$this->table);
64 64
 
65 65
         $this->sendResponseForSave('alert_add_data_success');
66 66
     }
@@ -79,7 +79,7 @@  discard block
 block discarded – undo
79 79
         app(RelationHandler::class)->save($this->table, $id, $this->data_inputan);
80 80
         $this->hookAfterEdit($id);
81 81
 
82
-        $this->insertLog('log_update', $id. ' on ' . $this->table);
82
+        $this->insertLog('log_update', $id.' on '.$this->table);
83 83
 
84 84
         $this->sendResponseForSave('alert_update_data_success');
85 85
     }
Please login to merge, or discard this patch.
src/controllers/Helpers/IndexExport.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -52,9 +52,9 @@
 block discarded – undo
52 52
      */
53 53
     private function exportExcelAs($filename, $response, $orientation, $fmt)
54 54
     {
55
-        return Excel::create($filename, function ($excel) use ($response, $orientation, $filename) {
55
+        return Excel::create($filename, function($excel) use ($response, $orientation, $filename) {
56 56
             $excel->setTitle($filename)->setCreator("crudbooster.com")->setCompany(cbGetsetting('appname'));
57
-            $excel->sheet($filename, function ($sheet) use ($response, $orientation) {
57
+            $excel->sheet($filename, function($sheet) use ($response, $orientation) {
58 58
                 $sheet->setOrientation($orientation);
59 59
                 $sheet->loadview('crudbooster::export', $response);
60 60
             });
Please login to merge, or discard this patch.
src/controllers/Helpers/IndexImport.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -49,7 +49,7 @@  discard block
 block discarded – undo
49 49
     function uploadImportData($file)
50 50
     {
51 51
         $dir = 'uploads/'.date('Y-m');
52
-        $filename = md5(str_random(5)).'.'. $file->getClientOriginalExtension();
52
+        $filename = md5(str_random(5)).'.'.$file->getClientOriginalExtension();
53 53
 
54 54
         //Create Directory Monthly
55 55
         Storage::makeDirectory($dir);
@@ -66,7 +66,7 @@  discard block
 block discarded – undo
66 66
      */
67 67
     function validateForImport($file)
68 68
     {
69
-        return Validator::make(['extension' => $file->getClientOriginalExtension(),], ['extension' => 'in:xls,xlsx,csv']);
69
+        return Validator::make(['extension' => $file->getClientOriginalExtension(), ], ['extension' => 'in:xls,xlsx,csv']);
70 70
     }
71 71
 
72 72
 
@@ -82,7 +82,7 @@  discard block
 block discarded – undo
82 82
 
83 83
         $file = base64_decode(request('file'));
84 84
         $file = 'storage'.DIRECTORY_SEPARATOR.'app'.DIRECTORY_SEPARATOR.$file;
85
-        $rows = Excel::load($file, function ($reader) {
85
+        $rows = Excel::load($file, function($reader) {
86 86
         })->get();
87 87
 
88 88
         //$data_import_column = [];
@@ -127,7 +127,7 @@  discard block
 block discarded – undo
127 127
         foreach ($select_column as $sk => $s) {
128 128
             $colname = $table_columns[$sk];
129 129
 
130
-            if (! CRUDBooster::isForeignKey($colname) || intval($value->$s)) {
130
+            if (!CRUDBooster::isForeignKey($colname) || intval($value->$s)) {
131 131
                 $a[$colname] = $value->$s;
132 132
                 continue;
133 133
             }
@@ -141,7 +141,7 @@  discard block
 block discarded – undo
141 141
             $relation_moduls = DB::table('cms_moduls')->where('table_name', $relation_table)->first();
142 142
 
143 143
             $relation_class = __NAMESPACE__.'\\'.$relation_moduls->controller;
144
-            if (! class_exists($relation_class)) {
144
+            if (!class_exists($relation_class)) {
145 145
                 $relation_class = '\App\Http\Controllers\\'.$relation_moduls->controller;
146 146
             }
147 147
             $relation_class = new $relation_class;
Please login to merge, or discard this patch.
src/controllers/FormValidator.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -19,7 +19,7 @@  discard block
 block discarded – undo
19 19
 
20 20
         $validator = Validator::make(request()->all(), $rules);
21 21
 
22
-        if (! $validator->fails()) {
22
+        if (!$validator->fails()) {
23 23
             return null;
24 24
         }
25 25
 
@@ -37,12 +37,12 @@  discard block
 block discarded – undo
37 37
         $rules = [];
38 38
         foreach ($form as $formInput) {
39 39
             $name = $formInput['name'];
40
-            if (! $name) {
40
+            if (!$name) {
41 41
                 continue;
42 42
             }
43 43
 
44 44
             $ai = [];
45
-            if ($formInput['required'] && ! Request::hasFile($name)) {
45
+            if ($formInput['required'] && !Request::hasFile($name)) {
46 46
                 $ai[] = 'required';
47 47
             }
48 48
 
@@ -71,7 +71,7 @@  discard block
 block discarded – undo
71 71
     {
72 72
         $exp = explode('|', $formInput['validation']);
73 73
 
74
-        if (! count($exp)) {
74
+        if (!count($exp)) {
75 75
             return '';
76 76
         }
77 77
 
Please login to merge, or discard this patch.
src/CRUDBoosterServiceProvider.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -53,16 +53,16 @@  discard block
 block discarded – undo
53 53
             __DIR__.'/userfiles/views/vendor/crudbooster/type_components/readme.txt' => resource_path('views/vendor/crudbooster/type_components/readme.txt'),
54 54
         ], 'cb_type_components');
55 55
 
56
-        if (! file_exists(app_path('Http/Controllers/CBHook.php'))) {
56
+        if (!file_exists(app_path('Http/Controllers/CBHook.php'))) {
57 57
             $this->publishes([__DIR__.'/userfiles/controllers/CBHook.php' => app_path('Http/Controllers/CBHook.php')], 'CBHook');
58 58
         }
59 59
 
60
-        if (! file_exists(app_path('Http/Controllers/AdminUsersController.php'))) {
60
+        if (!file_exists(app_path('Http/Controllers/AdminUsersController.php'))) {
61 61
             $this->publishes([__DIR__.'/userfiles/controllers/AdminUsersController.php' => app_path('Http/Controllers/AdminUsersController.php')], 'cb_user_controller');
62 62
         }
63 63
 
64 64
         $this->defineValidationRules();
65
-        $this->loadRoutesFrom( __DIR__.'/routes.php');
65
+        $this->loadRoutesFrom(__DIR__.'/routes.php');
66 66
     }
67 67
 
68 68
     /**
@@ -74,7 +74,7 @@  discard block
 block discarded – undo
74 74
     {
75 75
         $this->mergeConfigFrom(__DIR__.'/configs/crudbooster.php', 'crudbooster');
76 76
 
77
-        $this->app->singleton('crudbooster', function () {
77
+        $this->app->singleton('crudbooster', function() {
78 78
             return true;
79 79
         });
80 80
 
@@ -115,7 +115,7 @@  discard block
 block discarded – undo
115 115
 
116 116
     private function registerCrudboosterCommand()
117 117
     {
118
-        $this->app->singleton('crudboosterinstall', function () {
118
+        $this->app->singleton('crudboosterinstall', function() {
119 119
             return new CrudboosterInstallationCommand;
120 120
         });
121 121
 
@@ -124,7 +124,7 @@  discard block
 block discarded – undo
124 124
 
125 125
     private function defineValidationRules()
126 126
     {
127
-        \Validator::extend('alpha_spaces', function ($attribute, $value) {
127
+        \Validator::extend('alpha_spaces', function($attribute, $value) {
128 128
             // This will only accept alpha and spaces.
129 129
             // If you want to accept hyphens use: /^[\pL\s-]+$/u.
130 130
             return preg_match('/^[\pL\s]+$/u', $value);
Please login to merge, or discard this patch.
src/helpers/cb_helpers.php 1 patch
Spacing   +22 added lines, -22 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,7 +69,7 @@  discard block
 block discarded – undo
69 69
     }
70 70
 }
71 71
 
72
-if (! function_exists('extract_unit')) {
72
+if (!function_exists('extract_unit')) {
73 73
     /*
74 74
     Credits: Bit Repository
75 75
     URL: http://www.bitrepository.com/extract-content-between-two-delimiters-with-php.html
@@ -87,7 +87,7 @@  discard block
 block discarded – undo
87 87
     }
88 88
 }
89 89
 
90
-if (! function_exists('now')) {
90
+if (!function_exists('now')) {
91 91
     function now()
92 92
     {
93 93
         return date('Y-m-d H:i:s');
@@ -101,17 +101,17 @@  discard block
 block discarded – undo
101 101
 | $name = name of input
102 102
 |
103 103
 */
104
-if (! function_exists('g')) {
104
+if (!function_exists('g')) {
105 105
     function g($name)
106 106
     {
107 107
         return Request::get($name);
108 108
     }
109 109
 }
110 110
 
111
-if (! function_exists('min_var_export')) {
111
+if (!function_exists('min_var_export')) {
112 112
     function min_var_export($input, $indent = "")
113 113
     {
114
-        if (! is_array($input)) {
114
+        if (!is_array($input)) {
115 115
             return var_export($input, true);
116 116
         }
117 117
         $buffer = [];
@@ -126,41 +126,41 @@  discard block
 block discarded – undo
126 126
     }
127 127
 }
128 128
 
129
-if (! function_exists('cbTrans')) {
129
+if (!function_exists('cbTrans')) {
130 130
     function cbTrans($key, $params = [])
131 131
     {
132 132
         return trans('crudbooster.'.$key, $params);
133 133
     }
134 134
 }
135 135
 
136
-if (! function_exists('cbAsset')) {
136
+if (!function_exists('cbAsset')) {
137 137
     function cbAsset($key)
138 138
     {
139 139
         return asset('vendor/crudbooster/assets/'.$key);
140 140
     }
141 141
 }
142 142
 
143
-if (! function_exists('cbScript')) {
143
+if (!function_exists('cbScript')) {
144 144
     function cbScript($key)
145 145
     {
146 146
         return '<script src="'.cbAsset($key).'" type="text/javascript"></script>';
147 147
     }
148 148
 }
149 149
 
150
-if (! function_exists('cbStyleSheet')) {
150
+if (!function_exists('cbStyleSheet')) {
151 151
     function cbStyleSheet($key)
152 152
     {
153 153
         return '<link rel="stylesheet" type="text/css" href="'.cbAsset($key).'"/>';
154 154
     }
155 155
 }
156 156
 
157
-if (! function_exists('cbConfig')) {
157
+if (!function_exists('cbConfig')) {
158 158
     function cbConfig($key, $default = null)
159 159
     {
160 160
         return config('crudbooster.'.$key, $default);
161 161
     }
162 162
 }
163
-if (! function_exists('makeValidationForHTML')) {
163
+if (!function_exists('makeValidationForHTML')) {
164 164
     function makeValidationForHTML($rules)
165 165
     {
166 166
         $validation = [];
@@ -178,7 +178,7 @@  discard block
 block discarded – undo
178 178
     }
179 179
 }
180 180
 
181
-if (! function_exists('findSelected')) {
181
+if (!function_exists('findSelected')) {
182 182
     /**
183 183
      * @param $rawvalue
184 184
      * @param $form
@@ -187,7 +187,7 @@  discard block
 block discarded – undo
187 187
      */
188 188
     function findSelected($rawvalue, $form, $optionValue)
189 189
     {
190
-        if (! $rawvalue) {
190
+        if (!$rawvalue) {
191 191
             return '';
192 192
         }
193 193
         $value = $rawvalue;
@@ -209,7 +209,7 @@  discard block
 block discarded – undo
209 209
         return $selected;
210 210
     }
211 211
 }
212
-if (! function_exists('array_get_keys')) {
212
+if (!function_exists('array_get_keys')) {
213 213
 
214 214
     /**
215 215
      * @param array $_array
@@ -225,14 +225,14 @@  discard block
 block discarded – undo
225 225
     }
226 226
 }
227 227
 
228
-if (! function_exists('cbGetSetting')) {
228
+if (!function_exists('cbGetSetting')) {
229 229
     function cbGetSetting($name)
230 230
     {
231 231
         return \crocodicstudio\crudbooster\Modules\SettingModule\SettingRepo::getSetting($name);
232 232
     }
233 233
 }
234 234
 
235
-if (! function_exists('backWithMsg')) {
235
+if (!function_exists('backWithMsg')) {
236 236
     function backWithMsg($msg, $type = 'success')
237 237
     {
238 238
         sendAndTerminate(redirect()->back()->with(['message_type' => $type, 'message' => $msg]));
Please login to merge, or discard this patch.
src/helpers/Time.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -31,7 +31,7 @@
 block discarded – undo
31 31
             }
32 32
         }
33 33
 
34
-        if (! $full) {
34
+        if (!$full) {
35 35
             $this->string = array_slice($this->string, 0, 1);
36 36
         }
37 37
 
Please login to merge, or discard this patch.