Completed
Pull Request — master (#1904)
by Rico
07:48
created
app/Http/Controllers/PendingChangesController.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -98,7 +98,7 @@  discard block
 block discarded – undo
98 98
     {
99 99
         $url       = $request->get('url', '');
100 100
         $xref      = $request->get('xref', '');
101
-        $change_id = (int)$request->get('change_id');
101
+        $change_id = (int) $request->get('change_id');
102 102
 
103 103
         $changes = Database::prepare(
104 104
             "SELECT change_id, xref, old_gedcom, new_gedcom" .
@@ -204,7 +204,7 @@  discard block
 block discarded – undo
204 204
     {
205 205
         $url       = $request->get('url', '');
206 206
         $xref      = $request->get('xref', '');
207
-        $change_id = (int)$request->get('change_id');
207
+        $change_id = (int) $request->get('change_id');
208 208
 
209 209
         // Reject a change, and subsequent changes to the same record
210 210
         Database::prepare(
Please login to merge, or discard this patch.
app/Module/UserMessagesModule.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -55,7 +55,7 @@  discard block
 block discarded – undo
55 55
      */
56 56
     public function postDeleteMessageAction(Request $request, Tree $tree): Response
57 57
     {
58
-        $message_ids = (array)$request->get('message_id', []);
58
+        $message_ids = (array) $request->get('message_id', []);
59 59
 
60 60
         $stmt = Database::prepare("DELETE FROM `##message` WHERE user_id = :user_id AND message_id = :message_id");
61 61
 
@@ -100,7 +100,7 @@  discard block
 block discarded – undo
100 100
 
101 101
         $content = '';
102 102
         if (!empty($users)) {
103
-            $url     = route('user-page', ['ged' => $tree->getName()]);
103
+            $url = route('user-page', ['ged' => $tree->getName()]);
104 104
             $content .= '<form onsubmit="return $(&quot;#to&quot;).val() !== &quot;&quot;">';
105 105
             $content .= '<input type="hidden" name="route" value="message">';
106 106
             $content .= '<input type="hidden" name="ged" value="' . e($tree->getName()) . '">';
@@ -136,7 +136,7 @@  discard block
 block discarded – undo
136 136
                 $content .= '<td class="list_value_wrap"><a href="#" onclick="return expand_layer(\'message' . $message->message_id . '\');"><i id="message' . $message->message_id . '_img" class="icon-plus"></i> <b dir="auto">' . e($message->subject) . '</b></a></td>';
137 137
                 $content .= '<td class="list_value_wrap">' . FunctionsDate::formatTimestamp($message->created + WT_TIMESTAMP_OFFSET) . '</td>';
138 138
                 $content .= '<td class="list_value_wrap">';
139
-                $user    = User::findByIdentifier($message->sender);
139
+                $user = User::findByIdentifier($message->sender);
140 140
                 if ($user) {
141 141
                     $content .= '<span dir="auto">' . e($user->getRealName()) . '</span> - <span dir="auto">' . $user->getEmail() . '</span>';
142 142
                 } else {
@@ -158,7 +158,7 @@  discard block
 block discarded – undo
158 158
                         'subject' => $message->subject,
159 159
                         'ged'     => $tree->getName(),
160 160
                     ]);
161
-                    $content   .= '<a class="btn btn-primary" href="' . e($reply_url) . '" title="' . I18N::translate('Reply') . '">' . I18N::translate('Reply') . '</a> ';
161
+                    $content .= '<a class="btn btn-primary" href="' . e($reply_url) . '" title="' . I18N::translate('Reply') . '">' . I18N::translate('Reply') . '</a> ';
162 162
                 }
163 163
                 $content .= '<button type="button" class="btn btn-danger" data-confirm="' . I18N::translate('Are you sure you want to delete this message? It cannot be retrieved later.') . '" onclick="if (confirm(this.dataset.confirm)) {$(\'#messageform :checkbox\').prop(\'checked\', false); $(\'#cb_message' . $message->message_id . '\').prop(\'checked\', true); document.messageform.submit();}">' . I18N::translate('Delete') . '</button></div></td></tr>';
164 164
             }
Please login to merge, or discard this patch.
app/Module/UserFavoritesModule.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -191,7 +191,7 @@
 block discarded – undo
191 191
      */
192 192
     public function postDeleteFavoriteAction(Request $request, Tree $tree, User $user): RedirectResponse
193 193
     {
194
-        $favorite_id = (int)$request->get('favorite_id');
194
+        $favorite_id = (int) $request->get('favorite_id');
195 195
 
196 196
         if (Auth::check()) {
197 197
             Database::prepare(
Please login to merge, or discard this patch.
app/Module/FrequentlyAskedQuestionsModule.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -156,7 +156,7 @@  discard block
 block discarded – undo
156 156
      */
157 157
     public function postAdminDeleteAction(Request $request, Tree $tree): RedirectResponse
158 158
     {
159
-        $block_id = (int)$request->get('block_id');
159
+        $block_id = (int) $request->get('block_id');
160 160
 
161 161
         Database::prepare(
162 162
             "DELETE FROM `##block_setting` WHERE block_id = :block_id"
@@ -184,7 +184,7 @@  discard block
 block discarded – undo
184 184
      */
185 185
     public function postAdminMoveDownAction(Request $request, Tree $tree): RedirectResponse
186 186
     {
187
-        $block_id = (int)$request->get('block_id');
187
+        $block_id = (int) $request->get('block_id');
188 188
 
189 189
         $block_order = Database::prepare(
190 190
             "SELECT block_order FROM `##block` WHERE block_id = :block_id"
@@ -237,7 +237,7 @@  discard block
 block discarded – undo
237 237
      */
238 238
     public function postAdminMoveUpAction(Request $request, Tree $tree): RedirectResponse
239 239
     {
240
-        $block_id = (int)$request->get('block_id');
240
+        $block_id = (int) $request->get('block_id');
241 241
 
242 242
         $block_order = Database::prepare(
243 243
             "SELECT block_order FROM `##block` WHERE block_id = :block_id"
@@ -292,7 +292,7 @@  discard block
 block discarded – undo
292 292
     {
293 293
         $this->layout = 'layouts/administration';
294 294
 
295
-        $block_id = (int)$request->get('block_id');
295
+        $block_id = (int) $request->get('block_id');
296 296
 
297 297
         if ($block_id === 0) {
298 298
             // Creating a new faq
@@ -303,7 +303,7 @@  discard block
 block discarded – undo
303 303
             )->execute([
304 304
                 'module_name' => $this->getName(),
305 305
             ])->fetchOne();
306
-            $languages   = [];
306
+            $languages = [];
307 307
 
308 308
             $title = I18N::translate('Add an FAQ');
309 309
         } else {
@@ -340,7 +340,7 @@  discard block
 block discarded – undo
340 340
      */
341 341
     public function postAdminEditAction(Request $request, Tree $tree): RedirectResponse
342 342
     {
343
-        $block_id  = (int)$request->get('block_id');
343
+        $block_id  = (int) $request->get('block_id');
344 344
         $faqbody   = $request->get('faqbody', '');
345 345
         $header    = $request->get('header', '');
346 346
         $languages = $request->get('languages', []);
Please login to merge, or discard this patch.
app/Module/FamilyTreeFavoritesModule.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -190,7 +190,7 @@
 block discarded – undo
190 190
      */
191 191
     public function postDeleteFavoriteAction(Request $request, Tree $tree, User $user): RedirectResponse
192 192
     {
193
-        $favorite_id = (int)$request->get('favorite_id');
193
+        $favorite_id = (int) $request->get('favorite_id');
194 194
 
195 195
         if (Auth::isManager($tree, $user)) {
196 196
             Database::prepare(
Please login to merge, or discard this patch.
app/Module/StoriesModule.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -117,7 +117,7 @@  discard block
 block discarded – undo
117 117
             // Only show this block for certain languages
118 118
             $languages = $this->getBlockSetting($block_id, 'languages', '');
119 119
             if ($languages === '' || in_array(WT_LOCALE, explode(',', $languages))) {
120
-                $stories[] = (object)[
120
+                $stories[] = (object) [
121 121
                     'block_id'   => $block_id,
122 122
                     'title'      => $this->getBlockSetting($block_id, 'title'),
123 123
                     'story_body' => $this->getBlockSetting($block_id, 'story_body'),
@@ -211,7 +211,7 @@  discard block
 block discarded – undo
211 211
     {
212 212
         $this->layout = 'layouts/administration';
213 213
 
214
-        $block_id = (int)$request->get('block_id');
214
+        $block_id = (int) $request->get('block_id');
215 215
 
216 216
         if ($block_id === 0) {
217 217
             // Creating a new story
@@ -256,7 +256,7 @@  discard block
 block discarded – undo
256 256
      */
257 257
     public function postAdminEditAction(Request $request, Tree $tree): RedirectResponse
258 258
     {
259
-        $block_id    = (int)$request->get('block_id');
259
+        $block_id    = (int) $request->get('block_id');
260 260
         $xref        = $request->get('xref', '');
261 261
         $story_body  = $request->get('story_body', '');
262 262
         $story_title = $request->get('story_title', '');
@@ -302,7 +302,7 @@  discard block
 block discarded – undo
302 302
      */
303 303
     public function postAdminDeleteAction(Request $request, Tree $tree): Response
304 304
     {
305
-        $block_id = (int)$request->get('block_id');
305
+        $block_id = (int) $request->get('block_id');
306 306
 
307 307
         Database::prepare(
308 308
             "DELETE FROM `##block_setting` WHERE block_id = :block_id"
Please login to merge, or discard this patch.
app/Http/Controllers/AdminSiteController.php 1 patch
Spacing   +24 added lines, -24 removed lines patch added patch discarded remove patch
@@ -263,35 +263,35 @@  discard block
 block discarded – undo
263 263
 
264 264
         $args = [];
265 265
         if ($search) {
266
-            $sql            .= " AND log_message LIKE CONCAT('%', :search, '%')";
266
+            $sql .= " AND log_message LIKE CONCAT('%', :search, '%')";
267 267
             $args['search'] = $search;
268 268
         }
269 269
         if ($from) {
270
-            $sql          .= " AND log_time >= :from";
270
+            $sql .= " AND log_time >= :from";
271 271
             $args['from'] = $from;
272 272
         }
273 273
         if ($to) {
274
-            $sql        .= " AND log_time < TIMESTAMPADD(DAY, 1 , :to)"; // before end of the day
274
+            $sql .= " AND log_time < TIMESTAMPADD(DAY, 1 , :to)"; // before end of the day
275 275
             $args['to'] = $to;
276 276
         }
277 277
         if ($type) {
278
-            $sql          .= " AND log_type = :type";
278
+            $sql .= " AND log_type = :type";
279 279
             $args['type'] = $type;
280 280
         }
281 281
         if ($text) {
282
-            $sql          .= " AND log_message LIKE CONCAT('%', :text, '%')";
282
+            $sql .= " AND log_message LIKE CONCAT('%', :text, '%')";
283 283
             $args['text'] = $text;
284 284
         }
285 285
         if ($ip) {
286
-            $sql        .= " AND ip_address LIKE CONCAT('%', :ip, '%')";
286
+            $sql .= " AND ip_address LIKE CONCAT('%', :ip, '%')";
287 287
             $args['ip'] = $ip;
288 288
         }
289 289
         if ($username) {
290
-            $sql          .= " AND user_name LIKE CONCAT('%', :user, '%')";
290
+            $sql .= " AND user_name LIKE CONCAT('%', :user, '%')";
291 291
             $args['user'] = $username;
292 292
         }
293 293
         if ($gedc) {
294
-            $sql          .= " AND gedcom_name = :gedc";
294
+            $sql .= " AND gedcom_name = :gedc";
295 295
             $args['gedc'] = $gedc;
296 296
         }
297 297
 
@@ -317,7 +317,7 @@  discard block
 block discarded – undo
317 317
         }
318 318
 
319 319
         if ($length) {
320
-            $sql            .= " LIMIT :limit OFFSET :offset";
320
+            $sql .= " LIMIT :limit OFFSET :offset";
321 321
             $args['limit']  = $length;
322 322
             $args['offset'] = $start;
323 323
         }
@@ -375,35 +375,35 @@  discard block
 block discarded – undo
375 375
 
376 376
         $args = [];
377 377
         if ($search) {
378
-            $sql            .= " AND log_message LIKE CONCAT('%', :search, '%')";
378
+            $sql .= " AND log_message LIKE CONCAT('%', :search, '%')";
379 379
             $args['search'] = $search;
380 380
         }
381 381
         if ($from) {
382
-            $sql          .= " AND log_time >= :from";
382
+            $sql .= " AND log_time >= :from";
383 383
             $args['from'] = $from;
384 384
         }
385 385
         if ($to) {
386
-            $sql        .= " AND log_time < TIMESTAMPADD(DAY, 1 , :to)"; // before end of the day
386
+            $sql .= " AND log_time < TIMESTAMPADD(DAY, 1 , :to)"; // before end of the day
387 387
             $args['to'] = $to;
388 388
         }
389 389
         if ($type) {
390
-            $sql          .= " AND log_type = :type";
390
+            $sql .= " AND log_type = :type";
391 391
             $args['type'] = $type;
392 392
         }
393 393
         if ($text) {
394
-            $sql          .= " AND log_message LIKE CONCAT('%', :text, '%')";
394
+            $sql .= " AND log_message LIKE CONCAT('%', :text, '%')";
395 395
             $args['text'] = $text;
396 396
         }
397 397
         if ($ip) {
398
-            $sql        .= " AND ip_address LIKE CONCAT('%', :ip, '%')";
398
+            $sql .= " AND ip_address LIKE CONCAT('%', :ip, '%')";
399 399
             $args['ip'] = $ip;
400 400
         }
401 401
         if ($username) {
402
-            $sql          .= " AND user_name LIKE CONCAT('%', :user, '%')";
402
+            $sql .= " AND user_name LIKE CONCAT('%', :user, '%')";
403 403
             $args['user'] = $username;
404 404
         }
405 405
         if ($gedc) {
406
-            $sql          .= " AND gedcom_name = :gedc";
406
+            $sql .= " AND gedcom_name = :gedc";
407 407
             $args['gedc'] = $gedc;
408 408
         }
409 409
 
@@ -436,31 +436,31 @@  discard block
 block discarded – undo
436 436
 
437 437
         $args = [];
438 438
         if ($from) {
439
-            $sql          .= " AND log_time >= :from";
439
+            $sql .= " AND log_time >= :from";
440 440
             $args['from'] = $from;
441 441
         }
442 442
         if ($to) {
443
-            $sql        .= " AND log_time < TIMESTAMPADD(DAY, 1 , :to)"; // before end of the day
443
+            $sql .= " AND log_time < TIMESTAMPADD(DAY, 1 , :to)"; // before end of the day
444 444
             $args['to'] = $to;
445 445
         }
446 446
         if ($type) {
447
-            $sql          .= " AND log_type = :type";
447
+            $sql .= " AND log_type = :type";
448 448
             $args['type'] = $type;
449 449
         }
450 450
         if ($text) {
451
-            $sql          .= " AND log_message LIKE CONCAT('%', :text, '%')";
451
+            $sql .= " AND log_message LIKE CONCAT('%', :text, '%')";
452 452
             $args['text'] = $text;
453 453
         }
454 454
         if ($ip) {
455
-            $sql        .= " AND ip_address LIKE CONCAT('%', :ip, '%')";
455
+            $sql .= " AND ip_address LIKE CONCAT('%', :ip, '%')";
456 456
             $args['ip'] = $ip;
457 457
         }
458 458
         if ($username) {
459
-            $sql          .= " AND user_name LIKE CONCAT('%', :user, '%')";
459
+            $sql .= " AND user_name LIKE CONCAT('%', :user, '%')";
460 460
             $args['user'] = $username;
461 461
         }
462 462
         if ($gedc) {
463
-            $sql          .= " AND gedcom_name = :gedc";
463
+            $sql .= " AND gedcom_name = :gedc";
464 464
             $args['gedc'] = $gedc;
465 465
         }
466 466
 
Please login to merge, or discard this patch.
app/Http/Controllers/AdminUsersController.php 2 patches
Indentation   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -240,7 +240,7 @@
 block discarded – undo
240 240
             // Link to send email to other users.
241 241
             if ($user_id != $user->getUserId()) {
242 242
                 $datum[4] = '<a href="' . e(route('message', ['to'  => $datum[2],
243
-                                                              'url' => route('admin-users'),
243
+                                                                'url' => route('admin-users'),
244 244
                     ])) . '">' . $datum[4] . '</a>';
245 245
             }
246 246
 
Please login to merge, or discard this 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.
app/Http/Controllers/TimelineChartController.php 1 patch
Spacing   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -60,11 +60,11 @@  discard block
 block discarded – undo
60 60
     {
61 61
         $this->checkModuleIsActive($tree, 'timeline_chart');
62 62
 
63
-        $scale = (int)$request->get('scale', self::SCALE_DEFAULT);
63
+        $scale = (int) $request->get('scale', self::SCALE_DEFAULT);
64 64
         $scale = min($scale, self::SCALE_MAX);
65 65
         $scale = max($scale, self::SCALE_MIN);
66 66
 
67
-        $xrefs = (array)$request->get('xrefs', []);
67
+        $xrefs = (array) $request->get('xrefs', []);
68 68
         $xrefs = array_unique($xrefs);
69 69
         $xrefs = array_filter($xrefs, function (string $xref) use ($tree): bool {
70 70
             $individual = Individual::getInstance($xref, $tree);
@@ -100,14 +100,14 @@  discard block
 block discarded – undo
100 100
 
101 101
         $zoom_in_url = route('timeline', [
102 102
             'ged'   => $tree->getName(),
103
-            'scale' => min(self::SCALE_MAX, $scale + (int)($scale * 0.2 + 1)),
103
+            'scale' => min(self::SCALE_MAX, $scale + (int) ($scale * 0.2 + 1)),
104 104
             'xrefs' => $xrefs,
105 105
         ]);
106 106
 
107 107
         $zoom_out_url = route('timeline', [
108 108
             'route' => 'timeline',
109 109
             'ged'   => $tree->getName(),
110
-            'scale' => max(self::SCALE_MIN, $scale - (int)($scale * 0.2 + 1)),
110
+            'scale' => max(self::SCALE_MIN, $scale - (int) ($scale * 0.2 + 1)),
111 111
             'xrefs' => $xrefs,
112 112
         ]);
113 113
 
@@ -132,11 +132,11 @@  discard block
 block discarded – undo
132 132
     {
133 133
         $this->checkModuleIsActive($tree, 'timeline_chart');
134 134
 
135
-        $scale = (int)$request->get('scale', self::SCALE_DEFAULT);
135
+        $scale = (int) $request->get('scale', self::SCALE_DEFAULT);
136 136
         $scale = min($scale, self::SCALE_MAX);
137 137
         $scale = max($scale, self::SCALE_MIN);
138 138
 
139
-        $xrefs = (array)$request->get('xrefs', []);
139
+        $xrefs = (array) $request->get('xrefs', []);
140 140
         $xrefs = array_unique($xrefs);
141 141
 
142 142
         /** @var Individual[] $individuals */
@@ -148,7 +148,7 @@  discard block
 block discarded – undo
148 148
             return $individual !== null && $individual->canShow();
149 149
         });
150 150
 
151
-        $baseyear    = (int)date('Y');
151
+        $baseyear    = (int) date('Y');
152 152
         $topyear     = 0;
153 153
         $indifacts   = [];
154 154
         $birthyears  = [];
@@ -183,7 +183,7 @@  discard block
 block discarded – undo
183 183
                         $topyear  = max($topyear, $date->y);
184 184
 
185 185
                         if (!$individual->isDead()) {
186
-                            $topyear = max($topyear, (int)date('Y'));
186
+                            $topyear = max($topyear, (int) date('Y'));
187 187
                         }
188 188
 
189 189
                         // do not add the same fact twice (prevents marriages from being added multiple times)
@@ -196,7 +196,7 @@  discard block
 block discarded – undo
196 196
         }
197 197
 
198 198
         if ($scale === 0) {
199
-            $scale = (int)(($topyear - $baseyear) / 20 * count($indifacts) / 4);
199
+            $scale = (int) (($topyear - $baseyear) / 20 * count($indifacts) / 4);
200 200
             if ($scale < 6) {
201 201
                 $scale = 6;
202 202
             }
Please login to merge, or discard this patch.