Completed
Push — master ( 3a42ce...8670ac )
by Iman
15s
created
src/controllers/CBController/Deleter.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -23,12 +23,12 @@  discard block
 block discarded – undo
23 23
         $this->cbLoader();
24 24
         $selectedIds = request('checkbox');
25 25
         $btnName = request('button_name');
26
-        if (! $selectedIds) {
26
+        if (!$selectedIds) {
27 27
             CB::redirect($_SERVER['HTTP_REFERER'], 'Please select at least one row!', 'warning');
28 28
         }
29 29
         if ($btnName == 'delete') {
30 30
             (new DataRemover($this))->doDeleteWithHook($selectedIds);
31
-            $this->insertLog('log_delete', implode(',', $selectedIds) . ' - '. $this->table);
31
+            $this->insertLog('log_delete', implode(',', $selectedIds).' - '.$this->table);
32 32
             backWithMsg(cbTrans('alert_delete_selected_success'));
33 33
         }
34 34
 
@@ -47,8 +47,8 @@  discard block
 block discarded – undo
47 47
         $message = cbTrans('alert_action', ['action' => $action]);
48 48
 
49 49
         if ($this->actionButtonSelected($id_selected, $button_name) === false) {
50
-            $message = ! empty($this->alert['message']) ? $this->alert['message'] : 'Error';
51
-            $type = ! empty($this->alert['type']) ? $this->alert['type'] : 'danger';
50
+            $message = !empty($this->alert['message']) ? $this->alert['message'] : 'Error';
51
+            $type = !empty($this->alert['type']) ? $this->alert['type'] : 'danger';
52 52
         }
53 53
 
54 54
         backWithMsg($message, $type);
@@ -67,7 +67,7 @@  discard block
 block discarded – undo
67 67
 
68 68
         $this->findRow($id)->update([$column => null]);
69 69
 
70
-        $this->insertLog('log_delete_image', $id . ' - '. $this->table);
70
+        $this->insertLog('log_delete_image', $id.' - '.$this->table);
71 71
 
72 72
         CB::redirect(Request::server('HTTP_REFERER'), cbTrans('alert_delete_data_success'), 'success');
73 73
     }
Please login to merge, or discard this patch.
src/Modules/EmailTemplates/CbEmailTemplatesServiceProvider.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -14,7 +14,7 @@
 block discarded – undo
14 14
     public function boot()
15 15
     {
16 16
         $this->app['view']->addNamespace('CbEmailTpl', __DIR__.'/views');
17
-        $this->loadRoutesFrom( __DIR__.'/email_templates_routes.php');
17
+        $this->loadRoutesFrom(__DIR__.'/email_templates_routes.php');
18 18
     }
19 19
 
20 20
     /**
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
@@ -76,7 +76,7 @@
 block discarded – undo
76 76
      */
77 77
     private function chechExtension($extension)
78 78
     {
79
-        if (! extension_loaded($extension)) {
79
+        if (!extension_loaded($extension)) {
80 80
             $this->console->info($extension.' extension: [Bad]');
81 81
             return $this->requirements = false;
82 82
         }
Please login to merge, or discard this patch.
src/Modules/ModuleGenerator/FileManipulator.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -229,7 +229,7 @@
 block discarded – undo
229 229
 
230 230
     public static function stringify($input, $indent = "")
231 231
     {
232
-        if (! is_array($input)) {
232
+        if (!is_array($input)) {
233 233
             return var_export($input, true);
234 234
         }
235 235
         $buffer = [];
Please login to merge, or discard this patch.
src/CBCoreModule/ViewHelpers.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -9,7 +9,7 @@
 block discarded – undo
9 9
         @$get = $_GET;
10 10
         $inputhtml = '';
11 11
 
12
-        if (! $get) {
12
+        if (!$get) {
13 13
             return $inputhtml;
14 14
         }
15 15
         if (is_array($exception)) {
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
@@ -50,7 +50,7 @@  discard block
 block discarded – undo
50 50
     function uploadImportData($file)
51 51
     {
52 52
         $dir = 'uploads/'.date('Y-m');
53
-        $filename = md5(str_random(5)).'.'. $file->getClientOriginalExtension();
53
+        $filename = md5(str_random(5)).'.'.$file->getClientOriginalExtension();
54 54
 
55 55
         //Create Directory Monthly
56 56
         Storage::makeDirectory($dir);
@@ -67,7 +67,7 @@  discard block
 block discarded – undo
67 67
      */
68 68
     function validateForImport($file)
69 69
     {
70
-        return Validator::make(['extension' => $file->getClientOriginalExtension(),], ['extension' => 'in:xls,xlsx,csv']);
70
+        return Validator::make(['extension' => $file->getClientOriginalExtension(), ], ['extension' => 'in:xls,xlsx,csv']);
71 71
     }
72 72
 
73 73
 
@@ -83,7 +83,7 @@  discard block
 block discarded – undo
83 83
 
84 84
         $file = base64_decode(request('file'));
85 85
         $file = 'storage'.DIRECTORY_SEPARATOR.'app'.DIRECTORY_SEPARATOR.$file;
86
-        $rows = Excel::load($file, function ($reader) {
86
+        $rows = Excel::load($file, function($reader) {
87 87
         })->get();
88 88
 
89 89
         //$data_import_column = [];
@@ -128,7 +128,7 @@  discard block
 block discarded – undo
128 128
         foreach ($select_column as $sk => $s) {
129 129
             $colname = $table_columns[$sk];
130 130
 
131
-            if (! DbInspector::isForeignKey($colname) || intval($value->$s)) {
131
+            if (!DbInspector::isForeignKey($colname) || intval($value->$s)) {
132 132
                 $a[$colname] = $value->$s;
133 133
                 continue;
134 134
             }
@@ -142,7 +142,7 @@  discard block
 block discarded – undo
142 142
             $relation_moduls = DB::table('cms_moduls')->where('table_name', $relation_table)->first();
143 143
 
144 144
             $relation_class = __NAMESPACE__.'\\'.$relation_moduls->controller;
145
-            if (! class_exists($relation_class)) {
145
+            if (!class_exists($relation_class)) {
146 146
                 $relation_class = '\App\Http\Controllers\\'.$relation_moduls->controller;
147 147
             }
148 148
             $relation_class = new $relation_class;
Please login to merge, or discard this patch.
src/helpers/cb_helpers.php 1 patch
Spacing   +23 added lines, -23 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,14 +101,14 @@  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('cbTrans')) {
111
+if (!function_exists('cbTrans')) {
112 112
     /**
113 113
      * Translate the given message.
114 114
      *
@@ -122,34 +122,34 @@  discard block
 block discarded – undo
122 122
     }
123 123
 }
124 124
 
125
-if (! function_exists('cbAsset')) {
125
+if (!function_exists('cbAsset')) {
126 126
     function cbAsset($key)
127 127
     {
128 128
         return asset('vendor/crudbooster/assets/'.$key);
129 129
     }
130 130
 }
131 131
 
132
-if (! function_exists('cbScript')) {
132
+if (!function_exists('cbScript')) {
133 133
     function cbScript($key)
134 134
     {
135 135
         return '<script src="'.cbAsset($key).'" type="text/javascript"></script>';
136 136
     }
137 137
 }
138 138
 
139
-if (! function_exists('cbStyleSheet')) {
139
+if (!function_exists('cbStyleSheet')) {
140 140
     function cbStyleSheet($key)
141 141
     {
142 142
         return '<link rel="stylesheet" type="text/css" href="'.cbAsset($key).'"/>';
143 143
     }
144 144
 }
145 145
 
146
-if (! function_exists('cbConfig')) {
146
+if (!function_exists('cbConfig')) {
147 147
     function cbConfig($key, $default = null)
148 148
     {
149 149
         return config('crudbooster.'.$key, $default);
150 150
     }
151 151
 }
152
-if (! function_exists('makeValidationForHTML')) {
152
+if (!function_exists('makeValidationForHTML')) {
153 153
     function makeValidationForHTML($rules)
154 154
     {
155 155
         $validation = [];
@@ -167,7 +167,7 @@  discard block
 block discarded – undo
167 167
     }
168 168
 }
169 169
 
170
-if (! function_exists('findSelected')) {
170
+if (!function_exists('findSelected')) {
171 171
     /**
172 172
      * @param $rawvalue
173 173
      * @param $form
@@ -176,7 +176,7 @@  discard block
 block discarded – undo
176 176
      */
177 177
     function findSelected($rawvalue, $form, $optionValue)
178 178
     {
179
-        if (! $rawvalue) {
179
+        if (!$rawvalue) {
180 180
             return '';
181 181
         }
182 182
         $value = $rawvalue;
@@ -198,7 +198,7 @@  discard block
 block discarded – undo
198 198
         return $selected;
199 199
     }
200 200
 }
201
-if (! function_exists('array_get_keys')) {
201
+if (!function_exists('array_get_keys')) {
202 202
 
203 203
     /**
204 204
      * @param array $_array
@@ -214,28 +214,28 @@  discard block
 block discarded – undo
214 214
     }
215 215
 }
216 216
 
217
-if (! function_exists('cbGetSetting')) {
217
+if (!function_exists('cbGetSetting')) {
218 218
     function cbGetSetting($name)
219 219
     {
220 220
         return \crocodicstudio\crudbooster\Modules\SettingModule\SettingRepo::getSetting($name);
221 221
     }
222 222
 }
223 223
 
224
-if (! function_exists('backWithMsg')) {
224
+if (!function_exists('backWithMsg')) {
225 225
     function backWithMsg($msg, $type = 'success')
226 226
     {
227 227
         sendAndTerminate(redirect()->back()->with(['message_type' => $type, 'message' => $msg]));
228 228
     }
229 229
 }
230 230
 
231
-if (! function_exists('underField')) {
231
+if (!function_exists('underField')) {
232 232
     function underField($help, $error)
233 233
     {
234
-        $error = $error ? "<i class='fa fa-info-circle'></i> $error":'' ;
234
+        $error = $error ? "<i class='fa fa-info-circle'></i> $error" : '';
235 235
         return "<div class='text-danger'>$error</div><p class='help-block'>$help</p>";
236 236
     }
237 237
 }
238
-if (! function_exists('cbIcon')) {
238
+if (!function_exists('cbIcon')) {
239 239
     function cbIcon($icon)
240 240
     {
241 241
         return '<i class=\'fa fa-'.$icon.'\'></i>';
Please login to merge, or discard this patch.
src/Modules/ModuleGenerator/Step3Handler.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -8,7 +8,7 @@
 block discarded – undo
8 8
 {
9 9
     public function showForm($id)
10 10
     {
11
-        $row = ModulesRepo::find($id);;
11
+        $row = ModulesRepo::find($id); ;
12 12
 
13 13
         $columns = DbInspector::getTableCols($row->table_name);
14 14
 
Please login to merge, or discard this patch.
src/CBCoreModule/RouteController.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
     private static function getControllerMethods($ctrl)
64 64
     {
65 65
         $controller_methods = (new \ReflectionClass($ctrl))->getMethods(\ReflectionMethod::IS_PUBLIC);
66
-        $controller_methods = array_filter($controller_methods, function ($method) {
66
+        $controller_methods = array_filter($controller_methods, function($method) {
67 67
             return ($method->class !== 'Illuminate\Routing\Controller' && $method->name !== 'getIndex');
68 68
         });
69 69
 
Please login to merge, or discard this patch.