Completed
Pull Request — master (#1904)
by Rico
07:48
created
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/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.
app/Functions/FunctionsPrintLists.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -53,7 +53,7 @@  discard block
 block discarded – undo
53 53
                 } else {
54 54
                     $size = 75.0 + 125.0 * ($count - $minimum) / ($maximum - $minimum);
55 55
                 }
56
-                $url  = route($route, [
56
+                $url = route($route, [
57 57
                     'surname' => $surn,
58 58
                     'ged'     => $tree->getName(),
59 59
                 ]);
@@ -130,13 +130,13 @@  discard block
 block discarded – undo
130 130
                 }
131 131
                 $newcol = ceil($count / $col);
132 132
                 $html2  = '<table class="list_table"><tr>';
133
-                $html2  .= '<td class="list_value" style="padding: 14px;">';
133
+                $html2 .= '<td class="list_value" style="padding: 14px;">';
134 134
 
135 135
                 foreach ($html as $surns) {
136 136
                     $html2 .= $surns . '<br>';
137 137
                     $i++;
138 138
                     if ($i == $newcol && $i < $count) {
139
-                        $html2  .= '</td><td class="list_value" style="padding: 14px;">';
139
+                        $html2 .= '</td><td class="list_value" style="padding: 14px;">';
140 140
                         $newcol = $i + ceil($count / $col);
141 141
                     }
142 142
                 }
Please login to merge, or discard this patch.
app/Http/Controllers/Auth/ForgotPasswordController.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -69,7 +69,7 @@  discard block
 block discarded – undo
69 69
 
70 70
             Log::addAuthenticationLog('Password request was sent to user: ' . $user->getUserName());
71 71
 
72
-            $sender = new User((object)[
72
+            $sender = new User((object) [
73 73
                 'user_id'   => null,
74 74
                 'user_name' => '',
75 75
                 'real_name' => $tree->getTitle(),
@@ -104,7 +104,7 @@  discard block
 block discarded – undo
104 104
         $max       = strlen($passchars) - 1;
105 105
 
106 106
         for ($i = 0; $i < 8; $i++) {
107
-            $index    = random_int(0, $max);
107
+            $index = random_int(0, $max);
108 108
             $password .= $passchars{$index};
109 109
         }
110 110
 
Please login to merge, or discard this patch.