Completed
Pull Request — master (#1904)
by Rico
09:54
created
app/Http/Controllers/MessageController.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -328,8 +328,8 @@  discard block
 block discarded – undo
328 328
     private function validContacts(Tree $tree): array
329 329
     {
330 330
         $contacts = [
331
-            User::find((int)$tree->getPreference('CONTACT_USER_ID')),
332
-            User::find((int)$tree->getPreference('WEBMASTER_USER_ID')),
331
+            User::find((int) $tree->getPreference('CONTACT_USER_ID')),
332
+            User::find((int) $tree->getPreference('WEBMASTER_USER_ID')),
333 333
         ];
334 334
 
335 335
         return array_filter($contacts);
@@ -353,7 +353,7 @@  discard block
 block discarded – undo
353 353
     {
354 354
         // Create a dummy user, so we can send messages from the tree.
355 355
         $from = new User(
356
-            (object)[
356
+            (object) [
357 357
                 'user_id'   => null,
358 358
                 'user_name' => '',
359 359
                 'real_name' => $tree->getTitle(),
@@ -363,7 +363,7 @@  discard block
 block discarded – undo
363 363
 
364 364
         // Create a dummy user, so we can reply to visitors.
365 365
         $sender = new User(
366
-            (object)[
366
+            (object) [
367 367
                 'user_id'   => null,
368 368
                 'user_name' => '',
369 369
                 'real_name' => $sender_name,
Please login to merge, or discard this patch.
app/Module/PlacesModule.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -141,7 +141,7 @@  discard block
 block discarded – undo
141 141
      */
142 142
     private function getPersonalFacts(Individual $individual): array
143 143
     {
144
-        $facts      = $individual->getFacts();
144
+        $facts = $individual->getFacts();
145 145
         foreach ($individual->getSpouseFamilies() as $family) {
146 146
             $facts = array_merge($facts, $family->getFacts());
147 147
             // Add birth of children from this family to the facts array
@@ -215,7 +215,7 @@  discard block
 block discarded – undo
215 215
                     'provider' => 'openstreetmap',
216 216
                     'style'    => 'mapnik',
217 217
                 ];
218
-                self::$map_providers  = [
218
+                self::$map_providers = [
219 219
                     'openstreetmap' => [
220 220
                         'name'   => 'OpenStreetMap',
221 221
                         'styles' => ['mapnik' => 'Mapnik'],
Please login to merge, or discard this patch.
app/Http/Controllers/AdminUsersController.php 1 patch
Spacing   +26 added lines, -26 removed lines patch added patch discarded remove patch
@@ -49,7 +49,7 @@  discard block
 block discarded – undo
49 49
      */
50 50
     public function cleanup(Request $request): Response
51 51
     {
52
-        $months = (int)$request->get('months', 6);
52
+        $months = (int) $request->get('months', 6);
53 53
 
54 54
         $inactive_threshold   = time() - $months * 30 * self::SECONDS_PER_DAY;
55 55
         $unverified_threshold = time() - 7 * self::SECONDS_PER_DAY;
@@ -58,9 +58,9 @@  discard block
 block discarded – undo
58 58
 
59 59
         $inactive_users = array_filter($users, function (User $user) use ($inactive_threshold): bool {
60 60
             if ($user->getPreference('sessiontime') === '0') {
61
-                $datelogin = (int)$user->getPreference('reg_timestamp');
61
+                $datelogin = (int) $user->getPreference('reg_timestamp');
62 62
             } else {
63
-                $datelogin = (int)$user->getPreference('sessiontime');
63
+                $datelogin = (int) $user->getPreference('sessiontime');
64 64
             }
65 65
 
66 66
             return $datelogin < $inactive_threshold && $user->getPreference('verified');
@@ -68,9 +68,9 @@  discard block
 block discarded – undo
68 68
 
69 69
         $unverified_users = array_filter($users, function (User $user) use ($unverified_threshold): bool {
70 70
             if ($user->getPreference('sessiontime') === '0') {
71
-                $datelogin = (int)$user->getPreference('reg_timestamp');
71
+                $datelogin = (int) $user->getPreference('reg_timestamp');
72 72
             } else {
73
-                $datelogin = (int)$user->getPreference('sessiontime');
73
+                $datelogin = (int) $user->getPreference('sessiontime');
74 74
             }
75 75
 
76 76
             return $datelogin < $unverified_threshold && !$user->getPreference('verified');
@@ -97,7 +97,7 @@  discard block
 block discarded – undo
97 97
     public function cleanupAction(Request $request): RedirectResponse
98 98
     {
99 99
         foreach (User::all() as $user) {
100
-            if ((bool)$request->get('del_' . $user->getUserId())) {
100
+            if ((bool) $request->get('del_' . $user->getUserId())) {
101 101
                 Log::addAuthenticationLog('Deleted user: ' . $user->getUserName());
102 102
                 $user->delete();
103 103
 
@@ -144,10 +144,10 @@  discard block
 block discarded – undo
144 144
     public function data(Request $request, User $user): JsonResponse
145 145
     {
146 146
         $search = $request->get('search')['value'];
147
-        $start  = (int)$request->get('start');
148
-        $length = (int)$request->get('length');
147
+        $start  = (int) $request->get('start');
148
+        $length = (int) $request->get('length');
149 149
         $order  = $request->get('order', []);
150
-        $draw   = (int)$request->get('draw');
150
+        $draw   = (int) $request->get('draw');
151 151
 
152 152
         $sql_select =
153 153
             "SELECT SQL_CALC_FOUND_ROWS u.user_id, user_name, real_name, email, us1.setting_value AS language, us2.setting_value AS registered_at, us3.setting_value AS active_at, us4.setting_value AS verified, us5.setting_value AS verified_by_admin" .
@@ -162,7 +162,7 @@  discard block
 block discarded – undo
162 162
         $args = [];
163 163
 
164 164
         if ($search) {
165
-            $sql_select       .= " AND (user_name LIKE CONCAT('%', :search_1, '%') OR real_name LIKE CONCAT('%', :search_2, '%') OR email LIKE CONCAT('%', :search_3, '%'))";
165
+            $sql_select .= " AND (user_name LIKE CONCAT('%', :search_1, '%') OR real_name LIKE CONCAT('%', :search_2, '%') OR email LIKE CONCAT('%', :search_3, '%'))";
166 166
             $args['search_1'] = $search;
167 167
             $args['search_2'] = $search;
168 168
             $args['search_3'] = $search;
@@ -191,7 +191,7 @@  discard block
 block discarded – undo
191 191
 
192 192
         if ($length) {
193 193
             $user->setPreference('admin_users_page_size', $length);
194
-            $sql_select     .= " LIMIT :limit OFFSET :offset";
194
+            $sql_select .= " LIMIT :limit OFFSET :offset";
195 195
             $args['limit']  = $length;
196 196
             $args['offset'] = $start;
197 197
         }
@@ -199,8 +199,8 @@  discard block
 block discarded – undo
199 199
         $rows = Database::prepare($sql_select)->execute($args)->fetchAll();
200 200
 
201 201
         // Total filtered/unfiltered rows
202
-        $recordsFiltered = (int)Database::prepare("SELECT FOUND_ROWS()")->fetchOne();
203
-        $recordsTotal    = (int)Database::prepare("SELECT COUNT(*) FROM `##user` WHERE user_id > 0")->fetchOne();
202
+        $recordsFiltered = (int) Database::prepare("SELECT FOUND_ROWS()")->fetchOne();
203
+        $recordsTotal    = (int) Database::prepare("SELECT COUNT(*) FROM `##user` WHERE user_id > 0")->fetchOne();
204 204
 
205 205
         $installed_languages = [];
206 206
         foreach (I18N::installedLocales() as $installed_locale) {
@@ -286,7 +286,7 @@  discard block
 block discarded – undo
286 286
      */
287 287
     public function edit(Request $request): Response
288 288
     {
289
-        $user_id = (int)$request->get('user_id');
289
+        $user_id = (int) $request->get('user_id');
290 290
         $user    = User::find($user_id);
291 291
 
292 292
         if ($user === null) {
@@ -369,7 +369,7 @@  discard block
 block discarded – undo
369 369
      */
370 370
     public function update(Request $request, User $user): RedirectResponse
371 371
     {
372
-        $user_id        = (int)$request->get('user_id');
372
+        $user_id        = (int) $request->get('user_id');
373 373
         $username       = $request->get('username');
374 374
         $real_name      = $request->get('real_name');
375 375
         $email          = $request->get('email');
@@ -379,11 +379,11 @@  discard block
 block discarded – undo
379 379
         $timezone       = $request->get('timezone');
380 380
         $contact_method = $request->get('contact_method');
381 381
         $comment        = $request->get('comment');
382
-        $auto_accept    = (bool)$request->get('auto_accept');
383
-        $canadmin       = (bool)$request->get('canadmin');
384
-        $visible_online = (bool)$request->get('visible_online');
385
-        $verified       = (bool)$request->get('verified');
386
-        $approved       = (bool)$request->get('approved');
382
+        $auto_accept    = (bool) $request->get('auto_accept');
383
+        $canadmin       = (bool) $request->get('canadmin');
384
+        $visible_online = (bool) $request->get('visible_online');
385
+        $verified       = (bool) $request->get('verified');
386
+        $approved       = (bool) $request->get('approved');
387 387
 
388 388
         $edit_user = User::find($user_id);
389 389
 
@@ -400,10 +400,10 @@  discard block
 block discarded – undo
400 400
             ->setPreference('TIMEZONE', $timezone)
401 401
             ->setPreference('contactmethod', $contact_method)
402 402
             ->setPreference('comment', $comment)
403
-            ->setPreference('auto_accept', (string)$auto_accept)
404
-            ->setPreference('visibleonline', (string)$visible_online)
405
-            ->setPreference('verified', (string)$verified)
406
-            ->setPreference('verified_by_admin', (string)$approved);
403
+            ->setPreference('auto_accept', (string) $auto_accept)
404
+            ->setPreference('visibleonline', (string) $visible_online)
405
+            ->setPreference('verified', (string) $verified)
406
+            ->setPreference('verified_by_admin', (string) $approved);
407 407
 
408 408
         if ($pass1 !== '') {
409 409
             $edit_user->setPassword($pass1);
@@ -415,7 +415,7 @@  discard block
 block discarded – undo
415 415
         }
416 416
 
417 417
         foreach (Tree::getAll() as $tree) {
418
-            $path_length = (int)$request->get('RELATIONSHIP_PATH_LENGTH' . $tree->getTreeId());
418
+            $path_length = (int) $request->get('RELATIONSHIP_PATH_LENGTH' . $tree->getTreeId());
419 419
             $gedcom_id   = $request->get('gedcomid' . $tree->getTreeId(), '');
420 420
             $can_edit    = $request->get('canedit' . $tree->getTreeId(), '');
421 421
 
@@ -426,7 +426,7 @@  discard block
 block discarded – undo
426 426
 
427 427
             $tree->setUserPreference($edit_user, 'gedcomid', $gedcom_id);
428 428
             $tree->setUserPreference($edit_user, 'canedit', $can_edit);
429
-            $tree->setUserPreference($edit_user, 'RELATIONSHIP_PATH_LENGTH', (string)$path_length);
429
+            $tree->setUserPreference($edit_user, 'RELATIONSHIP_PATH_LENGTH', (string) $path_length);
430 430
         }
431 431
 
432 432
         $url = route('admin-users');
Please login to merge, or discard this patch.
themes/webtrees/theme.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -1,5 +1,5 @@
 block discarded – undo
1 1
 <?php
2
-declare(strict_types = 1);
2
+declare(strict_types=1);
3 3
 /**
4 4
  * webtrees: online genealogy
5 5
  * Copyright (C) 2018 webtrees development team
Please login to merge, or discard this patch.
themes/minimal/theme.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -1,5 +1,5 @@
 block discarded – undo
1 1
 <?php
2
-declare(strict_types = 1);
2
+declare(strict_types=1);
3 3
 /**
4 4
  * webtrees: online genealogy
5 5
  * Copyright (C) 2018 webtrees development team
Please login to merge, or discard this patch.
themes/fab/theme.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -1,5 +1,5 @@
 block discarded – undo
1 1
 <?php
2
-declare(strict_types = 1);
2
+declare(strict_types=1);
3 3
 /**
4 4
  * webtrees: online genealogy
5 5
  * Copyright (C) 2018 webtrees development team
Please login to merge, or discard this patch.
themes/clouds/theme.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -1,5 +1,5 @@
 block discarded – undo
1 1
 <?php
2
-declare(strict_types = 1);
2
+declare(strict_types=1);
3 3
 /**
4 4
  * webtrees: online genealogy
5 5
  * Copyright (C) 2018 webtrees development team
Please login to merge, or discard this patch.
themes/colors/theme.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -1,5 +1,5 @@
 block discarded – undo
1 1
 <?php
2
-declare(strict_types = 1);
2
+declare(strict_types=1);
3 3
 /**
4 4
  * webtrees: online genealogy
5 5
  * Copyright (C) 2018 webtrees development team
Please login to merge, or discard this patch.
themes/xenea/theme.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -1,5 +1,5 @@
 block discarded – undo
1 1
 <?php
2
-declare(strict_types = 1);
2
+declare(strict_types=1);
3 3
 /**
4 4
  * webtrees: online genealogy
5 5
  * Copyright (C) 2018 webtrees development team
Please login to merge, or discard this patch.