Passed
Push — master ( 080a6c...c98abf )
by Jonathan
17:45
created
app/Http/Controllers/User/AccountController.php 1 patch
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -52,9 +52,9 @@  discard block
 block discarded – undo
52 52
         });
53 53
 
54 54
         $validator = Validator::make(request()->all(), [
55
-            'username' => $rules['username'],
56
-            'name' => $rules['name'],
57
-            'email' => $rules['email'],
55
+            'username' => $rules[ 'username' ],
56
+            'name' => $rules[ 'name' ],
57
+            'email' => $rules[ 'email' ],
58 58
         ]);
59 59
 
60 60
         if ($validator->fails()) {
@@ -93,11 +93,11 @@  discard block
 block discarded – undo
93 93
         if (request('avatar')) {
94 94
             $image = str_replace('data:image/png;base64,', '', request('avatar'));
95 95
             $image = str_replace(' ', '+', $image);
96
-            $imageName = 'user-' . $user->id . '.png';
96
+            $imageName = 'user-'.$user->id.'.png';
97 97
             $path = storage_path('app/public/avatar/');
98
-            $filepath = $path . $imageName;
98
+            $filepath = $path.$imageName;
99 99
 
100
-            if(!\File::isDirectory($path)){
100
+            if (!\File::isDirectory($path)) {
101 101
                 \File::makeDirectory($path, 0777, true, true);
102 102
             }
103 103
 
@@ -128,7 +128,7 @@  discard block
 block discarded – undo
128 128
 
129 129
         $field = Field::where('module_id', ucmodule('user')->id)->where('name', 'password')->first();
130 130
         $password_rules = isset($field->data->rules) ? explode('|', $field->data->rules) : '';
131
-        $password_rules[] = 'confirmed';
131
+        $password_rules[ ] = 'confirmed';
132 132
 
133 133
         $validator = Validator::make(request()->all(), [
134 134
             'current_password' => function($attribute, $value, $fail) use ($user) {
Please login to merge, or discard this patch.
app/Http/Controllers/Core/ListController.php 1 patch
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -51,7 +51,7 @@  discard block
 block discarded – undo
51 51
             ->get();
52 52
 
53 53
         // Order by
54
-        $filterOrderBy = (array) $selectedFilter->order_by;
54
+        $filterOrderBy = (array)$selectedFilter->order_by;
55 55
 
56 56
         return $this->autoView(compact('datatableColumns', 'filters', 'selectedFilter', 'filterOrderBy'));
57 57
     }
@@ -115,7 +115,7 @@  discard block
 block discarded – undo
115 115
             if ($relatedList && $relatedList->method) {
116 116
                 // Related list method
117 117
                 $method = $relatedList->method;
118
-                $recordIdsMethod = $method . 'RecordIds';
118
+                $recordIdsMethod = $method.'RecordIds';
119 119
 
120 120
                 // Get related records ids
121 121
                 $model = new $modelClass;
@@ -123,7 +123,7 @@  discard block
 block discarded – undo
123 123
 
124 124
                 // Add the record id itself to be filtered
125 125
                 if ($relatedList->module_id === $relatedList->related_module_id && !empty($recordId) && !$filteredRecordIds->contains($recordId)) {
126
-                    $filteredRecordIds[] = (int)$recordId;
126
+                    $filteredRecordIds[ ] = (int)$recordId;
127 127
                 }
128 128
 
129 129
                 // Make the quer
@@ -134,7 +134,7 @@  discard block
 block discarded – undo
134 134
             $records = $query->paginate($length);
135 135
         }
136 136
 
137
-        $records->getCollection()->transform(function ($record) use ($domain, $module) {
137
+        $records->getCollection()->transform(function($record) use ($domain, $module) {
138 138
             foreach ($module->fields as $field) {
139 139
                 // If a special template exists, use it. Else use the generic template
140 140
                 $uitype = uitype($field->uitype_id);
@@ -174,7 +174,7 @@  discard block
 block discarded – undo
174 174
         $results = collect();
175 175
         if (method_exists($modelClass, 'getSearchResult') && property_exists($modelClass, 'searchableColumns')) {
176 176
             $searchResults = new Search();
177
-            $searchResults->registerModel($modelClass, (array) (new $modelClass)->searchableColumns);
177
+            $searchResults->registerModel($modelClass, (array)(new $modelClass)->searchableColumns);
178 178
             $results = $searchResults->search($q)->take(config('uccello.max_results.autocomplete', 10));
179 179
         }
180 180
 
@@ -195,9 +195,9 @@  discard block
 block discarded – undo
195 195
         $savePageLength = $request->input('save_page_length');
196 196
 
197 197
         // Optional data
198
-        $data = [];
198
+        $data = [ ];
199 199
         if ($savePageLength) {
200
-            $data["length"] = $request->input('page_length');
200
+            $data[ "length" ] = $request->input('page_length');
201 201
         }
202 202
 
203 203
         $filter = Filter::firstOrNew([
Please login to merge, or discard this patch.
app/Widgets/RelatedlistWidget.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -20,19 +20,19 @@
 block discarded – undo
20 20
     public function run()
21 21
     {
22 22
         // Get module
23
-        $module = ucmodule($this->config['module']);
23
+        $module = ucmodule($this->config[ 'module' ]);
24 24
 
25 25
         // Get record
26 26
         $modelClass = $module->model_class;
27
-        $record = $modelClass::find($this->config['record_id']);
27
+        $record = $modelClass::find($this->config[ 'record_id' ]);
28 28
 
29 29
         return view('uccello::widgets.relatedlist', [
30 30
             'config' => $this->config,
31
-            'domain' => ucdomain($this->config['domain']),
31
+            'domain' => ucdomain($this->config[ 'domain' ]),
32 32
             'module' => $module,
33
-            'data' => (object) $this->config['data'],
33
+            'data' => (object)$this->config[ 'data' ],
34 34
             'record' => $record,
35
-            'label' => $this->config['data']->label ?? $this->config['labelForTranslation'],
35
+            'label' => $this->config[ 'data' ]->label ?? $this->config[ 'labelForTranslation' ],
36 36
         ]);
37 37
     }
38 38
 }
Please login to merge, or discard this patch.
database/migrations/2018_04_15_000028_add_default_data.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -46,7 +46,7 @@  discard block
 block discarded – undo
46 46
         ]);
47 47
 
48 48
         Entity::create([
49
-            'id' => (string) Str::uuid(),
49
+            'id' => (string)Str::uuid(),
50 50
             'module_id' => ucmodule('domain')->id,
51 51
             'record_id' => $domain->getKey(),
52 52
         ]);
@@ -61,7 +61,7 @@  discard block
 block discarded – undo
61 61
         ]);
62 62
 
63 63
         Entity::create([
64
-            'id' => (string) Str::uuid(),
64
+            'id' => (string)Str::uuid(),
65 65
             'module_id' => ucmodule('profile')->id,
66 66
             'record_id' => $profile->getKey(),
67 67
         ]);
@@ -91,7 +91,7 @@  discard block
 block discarded – undo
91 91
         $role->profiles()->attach($profile);
92 92
 
93 93
         Entity::create([
94
-            'id' => (string) Str::uuid(),
94
+            'id' => (string)Str::uuid(),
95 95
             'module_id' => ucmodule('role')->id,
96 96
             'record_id' => $role->getKey(),
97 97
         ]);
Please login to merge, or discard this patch.
database/migrations/2018_04_15_000031_alter_role_module.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -33,7 +33,7 @@
 block discarded – undo
33 33
             'uitype_id' => uitype('boolean')->id,
34 34
             'displaytype_id' => displaytype('everywhere')->id,
35 35
             'sequence' => 3,
36
-            'data' => [ 'info' => 'field_info.see_descendants_records']
36
+            'data' => [ 'info' => 'field_info.see_descendants_records' ]
37 37
         ]);
38 38
 
39 39
         $filter = Filter::where('module_id', $roleModule->id)->where('name', 'filter.all')->first();
Please login to merge, or discard this patch.
app/Http/Controllers/User/EditController.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -44,7 +44,7 @@
 block discarded – undo
44 44
         foreach ($treeDomainsIds as $treeDomainId) {
45 45
             $_domain = Domain::find($treeDomainId);
46 46
             foreach ($_domain->roles as $role) {
47
-                $roleName = $_domain->id === $domain->id ? $role->name : $_domain->name . ' > ' . $role->name;
47
+                $roleName = $_domain->id === $domain->id ? $role->name : $_domain->name.' > '.$role->name;
48 48
                 $roles[ $role->id ] = $roleName;
49 49
             }
50 50
         }
Please login to merge, or discard this patch.
app/Models/User.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -139,7 +139,7 @@  discard block
 block discarded – undo
139 139
 
140 140
         $i = 0;
141 141
         foreach ($words as $w) {
142
-            $initials .= $w[0];
142
+            $initials .= $w[ 0 ];
143 143
             $i++;
144 144
 
145 145
             if ($i === 3) { // Maximum: 3 letters
@@ -160,7 +160,7 @@  discard block
 block discarded – undo
160 160
         $image = 'vendor/uccello/uccello/images/user-no-image.png';
161 161
 
162 162
         if ($this->avatarType === 'gravatar') {
163
-            $image = 'https://www.gravatar.com/avatar/' . md5($this->email) . '?d=mm';
163
+            $image = 'https://www.gravatar.com/avatar/'.md5($this->email).'?d=mm';
164 164
 
165 165
         } elseif ($this->avatarType === 'image' && !empty($this->avatar->path)) {
166 166
             $image = $this->avatar->path;
@@ -177,7 +177,7 @@  discard block
 block discarded – undo
177 177
      */
178 178
     public function rolesOnDomain($domain) : Collection
179 179
     {
180
-        return Cache::remember('domain_'.$domain->slug.'_roles', 600, function () use($domain) {
180
+        return Cache::remember('domain_'.$domain->slug.'_roles', 600, function() use($domain) {
181 181
             $roles = collect();
182 182
 
183 183
             if (config('uccello.roles.display_ancestors_roles')) {
@@ -225,7 +225,7 @@  discard block
 block discarded – undo
225 225
 
226 226
         $hasRole = false;
227 227
 
228
-        $descendants = Cache::remember('domain_'.$domain->slug.'_descendants', 600, function () use($domain) {
228
+        $descendants = Cache::remember('domain_'.$domain->slug.'_descendants', 600, function() use($domain) {
229 229
             return $domain->findDescendants()->get();
230 230
         });
231 231
 
@@ -251,7 +251,7 @@  discard block
 block discarded – undo
251 251
     {
252 252
         $keyName = 'user_'.$this->id.'_'.$domain->slug.'_'.$module->name.'_capabilities';
253 253
 
254
-        return Cache::remember($keyName, 600, function () use($domain, $module) {
254
+        return Cache::remember($keyName, 600, function() use($domain, $module) {
255 255
             $capabilities = collect();
256 256
 
257 257
             // Get the domain and all its parents
@@ -305,7 +305,7 @@  discard block
 block discarded – undo
305 305
 
306 306
         $keyName = 'user_'.$this->id.'_'.$domain->slug.'_can_access_to_settings_panel';
307 307
 
308
-        return Cache::remember($keyName, 600, function () use($domain) {
308
+        return Cache::remember($keyName, 600, function() use($domain) {
309 309
 
310 310
             $hasCapability = false;
311 311
 
Please login to merge, or discard this patch.