Passed
Push — master ( 8a11c6...6b1f98 )
by Ferry
05:50
created
src/Modules/ModuleGenerator/AdminModulesController.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -15,7 +15,7 @@  discard block
 block discarded – undo
15 15
     {
16 16
         $this->table = 'cms_moduls';
17 17
         $this->primaryKey = 'id';
18
-        $this->titleField = 'name' ;
18
+        $this->titleField = 'name';
19 19
         $this->limit = 100;
20 20
         $this->buttonAdd = false;
21 21
         $this->buttonExport = false;
@@ -55,7 +55,7 @@  discard block
 block discarded – undo
55 55
 
56 56
     function hookBeforeDelete($ids)
57 57
     {
58
-        foreach ($ids as $id){
58
+        foreach ($ids as $id) {
59 59
             $controller = ModulesRepo::getControllerName($id);
60 60
             DB::table('cms_menus')->where('path', 'like', '%'.$controller.'%')->delete();
61 61
             @unlink(controller_path($controller));
Please login to merge, or discard this patch.
src/CBCoreModule/FileUploader.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -10,7 +10,7 @@  discard block
 block discarded – undo
10 10
 {
11 11
     public function uploadFile($name)
12 12
     {
13
-        if (! Request::hasFile($name)) {
13
+        if (!Request::hasFile($name)) {
14 14
             return null;
15 15
         }
16 16
         $file = Request::file($name);
@@ -33,7 +33,7 @@  discard block
 block discarded – undo
33 33
      */
34 34
     private function validateExtension($ext)
35 35
     {
36
-        if (! FieldDetector::isUploadField($ext)) {
36
+        if (!FieldDetector::isUploadField($ext)) {
37 37
             sendAndTerminate(response()->json("The filetype is not allowed!"));
38 38
         }
39 39
     }
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
@@ -23,7 +23,7 @@
 block discarded – undo
23 23
     public function handle($result, $table)
24 24
     {
25 25
         $orderby = $this->ctrl->orderby;
26
-        if (! $orderby) {
26
+        if (!$orderby) {
27 27
             $result->orderby($table.'.'.$this->ctrl->primaryKey, 'desc');
28 28
             return;
29 29
         }
Please login to merge, or discard this patch.
src/helpers/CRUDBooster.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -96,7 +96,7 @@  discard block
 block discarded – undo
96 96
     public static function first($table, $id)
97 97
     {
98 98
         $table = self::parseSqlTable($table)['table'];
99
-        if (! is_array($id)) {
99
+        if (!is_array($id)) {
100 100
             $pk = DbInspector::findPK($table);
101 101
 
102 102
             return DB::table($table)->where($pk, $id)->first();
@@ -122,7 +122,7 @@  discard block
 block discarded – undo
122 122
         $controllerName = basename($controllerName);
123 123
         $routeUrl = route($controllerName.'GetIndex');
124 124
 
125
-        if (! $path) {
125
+        if (!$path) {
126 126
             return trim($routeUrl, '/');
127 127
         }
128 128
 
@@ -152,7 +152,7 @@  discard block
 block discarded – undo
152 152
     {
153 153
         $tables = DbInspector::listTables();
154 154
 
155
-        $filter = function ($tableName) {
155
+        $filter = function($tableName) {
156 156
 
157 157
             if ($tableName == config('database.migrations')) {
158 158
                 return false;
Please login to merge, or discard this patch.
src/Modules/ApiGeneratorModule/AdminColumnsTableController.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -26,8 +26,8 @@  discard block
 block discarded – undo
26 26
 
27 27
         $result = \Schema::getColumnListing($table);
28 28
 
29
-        $result = array_filter($result, function ($row) {
30
-            return ! (in_array($row, ['created_at', 'deleted_at', 'updated_at']));
29
+        $result = array_filter($result, function($row) {
30
+            return !(in_array($row, ['created_at', 'deleted_at', 'updated_at']));
31 31
         });
32 32
 
33 33
         $newResult = [];
@@ -35,7 +35,7 @@  discard block
 block discarded – undo
35 35
             $type = \Schema::getColumnType($table, $row);
36 36
             $newResult[] = ['name' => $row, 'type' => $this->getFieldType($row, $type)];
37 37
 
38
-            if (! in_array($type, ['list', 'detail']) || ! starts_with($row, 'id_')) {
38
+            if (!in_array($type, ['list', 'detail']) || !starts_with($row, 'id_')) {
39 39
                 continue;
40 40
             }
41 41
 
@@ -80,8 +80,8 @@  discard block
 block discarded – undo
80 80
         }
81 81
         $table2 = substr($ro, 3);
82 82
         $columns = DB::getSchemaBuilder()->getColumnListing($table2);
83
-        $columns = array_filter($columns, function ($col) {
84
-            return ! FieldDetector::isExceptional($col);
83
+        $columns = array_filter($columns, function($col) {
84
+            return !FieldDetector::isExceptional($col);
85 85
         });
86 86
 
87 87
         foreach ($columns as $col) {
Please login to merge, or discard this patch.
src/CBCoreModule/CbRouter.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -60,7 +60,7 @@
 block discarded – undo
60 60
     {
61 61
         $methods = (new \ReflectionClass($ctrl))->getMethods(\ReflectionMethod::IS_PUBLIC);
62 62
 
63
-        return array_filter($methods, function ($method) {
63
+        return array_filter($methods, function($method) {
64 64
             return ($method->class !== 'Illuminate\Routing\Controller' && $method->name !== 'getIndex');
65 65
         });
66 66
     }
Please login to merge, or discard this patch.
src/CBCoreModule/Index.php 1 patch
Spacing   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -68,7 +68,7 @@  discard block
 block discarded – undo
68 68
         if ($filter_is_orderby === true) {
69 69
             (new Order($this->cb))->handle($result, $table);
70 70
         }
71
-        $limit = is_string($limit) ? (int)$limit : 15;
71
+        $limit = is_string($limit) ? (int) $limit : 15;
72 72
         $data['result'] = $result->paginate($limit);
73 73
 
74 74
         $data['columns'] = $columns_table;
@@ -80,7 +80,7 @@  discard block
 block discarded – undo
80 80
         //LISTING INDEX HTML
81 81
         $addAction = $CbCtrl->data['addAction'];
82 82
 
83
-        if (! empty($CbCtrl->sub_module)) {
83
+        if (!empty($CbCtrl->sub_module)) {
84 84
             $addAction = $this->_handleSubModules($addAction);
85 85
         }
86 86
 
@@ -101,7 +101,7 @@  discard block
 block discarded – undo
101 101
     private function _handleParentTable()
102 102
     {
103 103
         $data = [];
104
-        $parent = (string)request('parent_table');
104
+        $parent = (string) request('parent_table');
105 105
         $pk = DbInspector::findPk(request('parent_table'));
106 106
 
107 107
         $data['parent_table'] = DB::table($parent)->where($pk, request('parent_id'))->first();
@@ -111,7 +111,7 @@  discard block
 block discarded – undo
111 111
             $data['parent_field'] = DbInspector::getTableForeignKey($parent);
112 112
         }
113 113
 
114
-        if (! $data['parent_field']) {
114
+        if (!$data['parent_field']) {
115 115
             return $data;
116 116
         }
117 117
 
@@ -129,7 +129,7 @@  discard block
 block discarded – undo
129 129
      */
130 130
     private function _filterForParent($result)
131 131
     {
132
-        if (! request('parent_id')) {
132
+        if (!request('parent_id')) {
133 133
             return null;
134 134
         }
135 135
 
@@ -143,7 +143,7 @@  discard block
 block discarded – undo
143 143
      */
144 144
     private function _filterOutSoftDeleted($tableColumns, $result)
145 145
     {
146
-        if (! in_array('deleted_at', $tableColumns)) {
146
+        if (!in_array('deleted_at', $tableColumns)) {
147 147
             return;
148 148
         }
149 149
         $result->where($this->table.'.deleted_at', '=', null);
@@ -202,9 +202,9 @@  discard block
 block discarded – undo
202 202
     private function _applyWhereAndQfilters($result, $columnsTable, $table)
203 203
     {
204 204
         if (request('q')) {
205
-            $result->where(function ($query) use ($columnsTable) {
205
+            $result->where(function($query) use ($columnsTable) {
206 206
                 foreach ($columnsTable as $col) {
207
-                    if (! $col['field_with']) {
207
+                    if (!$col['field_with']) {
208 208
                         continue;
209 209
                     }
210 210
                     $query->orwhere($col['field_with'], "like", "%".request("q")."%");
@@ -248,7 +248,7 @@  discard block
 block discarded – undo
248 248
         return CRUDBooster::adminPath($module['path']).'?parent_table='.$table_parent.'&parent_columns='
249 249
             .$module['parent_columns'].'&parent_columns_alias='
250 250
             .$module['parent_columns_alias'].'&parent_id=['
251
-            .(! isset($module['custom_parent_id']) ? "id" : $module['custom_parent_id'])
251
+            .(!isset($module['custom_parent_id']) ? "id" : $module['custom_parent_id'])
252 252
             .']&return_url='.urlencode(Request::fullUrl()).'&foreign_key='
253 253
             .$module['foreign_key'].'&label='.urlencode($module['label']);
254 254
     }
Please login to merge, or discard this patch.
src/commands/CrudboosterInstallationCommand.php 1 patch
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -34,7 +34,7 @@  discard block
 block discarded – undo
34 34
 
35 35
         $printer->printHeader();
36 36
 
37
-        if (! ((new RequirementChecker($this))->check())) {
37
+        if (!((new RequirementChecker($this))->check())) {
38 38
             $this->info('Sorry unfortunately your system is not meet with our requirements !');
39 39
             $printer->printFooter(false);
40 40
             $this->info('--');
@@ -75,11 +75,11 @@  discard block
 block discarded – undo
75 75
     private function createVendorAtPublic()
76 76
     {
77 77
         $this->info('Checking public/vendor directory...');
78
-        if (! file_exists(public_path('vendor'))) {
78
+        if (!file_exists(public_path('vendor'))) {
79 79
             mkdir(public_path('vendor'), 0777);
80 80
         }
81 81
 
82
-        if (! is_writable(public_path('vendor'))) {
82
+        if (!is_writable(public_path('vendor'))) {
83 83
             $this->info('Setup aborted !');
84 84
             $this->info('Please set public/vendor directory to writable 0777');
85 85
             exit;
@@ -89,7 +89,7 @@  discard block
 block discarded – undo
89 89
     private function symlinkForUpload()
90 90
     {
91 91
         $this->info('Checking public/uploads symlink...');
92
-        if (! file_exists(public_path('uploads'))) {
92
+        if (!file_exists(public_path('uploads'))) {
93 93
             $this->info('Creating public/uploads symlink...');
94 94
             app('files')->link(storage_path('app'), public_path('uploads'));
95 95
 
@@ -106,7 +106,7 @@  discard block
 block discarded – undo
106 106
 
107 107
     private function rrmdir($dir)
108 108
     {
109
-        if (! is_dir($dir)) {
109
+        if (!is_dir($dir)) {
110 110
             return;
111 111
         }
112 112
         foreach (scandir($dir) as $object) {
@@ -131,7 +131,7 @@  discard block
 block discarded – undo
131 131
 
132 132
         $vendorPath = public_path('vendor'.DIRECTORY_SEPARATOR.'crudbooster');
133 133
 
134
-        if (! file_exists($vendorPath)) {
134
+        if (!file_exists($vendorPath)) {
135 135
             $this->info('Creating public/vendor/crudbooster symlink...');
136 136
             app('files')->link(__DIR__.'/../assets', public_path('vendor/crudbooster'));
137 137
 
@@ -163,7 +163,7 @@  discard block
 block discarded – undo
163 163
         $this->info('Migrating database...');
164 164
         $this->call('migrate', ['--path' => '\database\migrations\crudbooster']);
165 165
 
166
-        if (! class_exists('CBSeeder')) {
166
+        if (!class_exists('CBSeeder')) {
167 167
             require_once __DIR__.'/../database/seeds/CBSeeder.php';
168 168
         }
169 169
         $this->callSilent('db:seed', ['--class' => 'CBSeeder']);
Please login to merge, or discard this patch.
src/Modules/PrivilegeModule/AdminPrivilegesController.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -99,7 +99,7 @@  discard block
 block discarded – undo
99 99
         foreach (Request::input('privileges', []) as $moduleId => $data) {
100 100
             //Check Menu
101 101
 
102
-            $arrs = array_get_keys($data, ['is_visible', 'is_create', 'is_read', 'is_edit', 'is_delete',], 0);
102
+            $arrs = array_get_keys($data, ['is_visible', 'is_create', 'is_read', 'is_edit', 'is_delete', ], 0);
103 103
             $this->savePermissions($id, $moduleId, $arrs);
104 104
         }
105 105
 
@@ -185,7 +185,7 @@  discard block
 block discarded – undo
185 185
         $this->col[] = [
186 186
             'label' => 'Superadmin',
187 187
             'name' => 'is_superadmin',
188
-            'callback' => function ($row) {
188
+            'callback' => function($row) {
189 189
                 return ($row->is_superadmin) ? "<span class='label label-success'>Superadmin</span>" : "<span class='label label-default'>Standard</span>";
190 190
             },
191 191
         ];
Please login to merge, or discard this patch.