Completed
Pull Request — master (#1854)
by Rico
09:04
created
app/Http/Controllers/EditFamilyController.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -62,7 +62,7 @@  discard block
 block discarded – undo
62 62
     public function reorderChildrenAction(Request $request, Tree $tree): Response
63 63
     {
64 64
         $xref   = $request->get('xref');
65
-        $order  = (array)$request->get('order', []);
65
+        $order  = (array) $request->get('order', []);
66 66
         $family = Family::getInstance($xref, $tree);
67 67
 
68 68
         $this->checkFamilyAccess($family, true);
@@ -138,7 +138,7 @@  discard block
 block discarded – undo
138 138
         $this->checkFamilyAccess($family, true);
139 139
 
140 140
         $PEDI      = $request->get('PEDI', '');
141
-        $keep_chan = (bool)$request->get('keep_chan');
141
+        $keep_chan = (bool) $request->get('keep_chan');
142 142
 
143 143
         $this->glevels = $request->get('glevels', []);
144 144
         $this->tag     = $request->get('tag', []);
@@ -155,7 +155,7 @@  discard block
 block discarded – undo
155 155
             }
156 156
         }
157 157
         $gedrec .= "\n" . GedcomCodePedi::createNewFamcPedi($PEDI, $xref);
158
-        if ((bool)$request->get('SOUR_INDI')) {
158
+        if ((bool) $request->get('SOUR_INDI')) {
159 159
             $gedrec = $this->handleUpdates($gedrec);
160 160
         } else {
161 161
             $gedrec = $this->updateRest($gedrec);
@@ -253,7 +253,7 @@  discard block
 block discarded – undo
253 253
             }
254 254
         }
255 255
 
256
-        if ((bool)$request->get('SOUR_INDI')) {
256
+        if ((bool) $request->get('SOUR_INDI')) {
257 257
             $gedrec = $this->handleUpdates($gedrec);
258 258
         } else {
259 259
             $gedrec = $this->updateRest($gedrec);
@@ -273,7 +273,7 @@  discard block
 block discarded – undo
273 273
                 $famrec .= $this->addNewFact($request, $tree, $match);
274 274
             }
275 275
         }
276
-        if ((bool)$request->get('SOUR_FAM')) {
276
+        if ((bool) $request->get('SOUR_FAM')) {
277 277
             $famrec = $this->handleUpdates($famrec);
278 278
         } else {
279 279
             $famrec = $this->updateRest($famrec);
Please login to merge, or discard this patch.
app/Http/Controllers/EditIndividualController.php 1 patch
Spacing   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -62,7 +62,7 @@  discard block
 block discarded – undo
62 62
     public function reorderMediaAction(Request $request, Tree $tree): Response
63 63
     {
64 64
         $xref       = $request->get('xref');
65
-        $order      = (array)$request->get('order', []);
65
+        $order      = (array) $request->get('order', []);
66 66
         $individual = Individual::getInstance($xref, $tree);
67 67
 
68 68
         $this->checkIndividualAccess($individual, true);
@@ -123,7 +123,7 @@  discard block
 block discarded – undo
123 123
     public function reorderNamesAction(Request $request, Tree $tree): Response
124 124
     {
125 125
         $xref       = $request->get('xref');
126
-        $order      = (array)$request->get('order', []);
126
+        $order      = (array) $request->get('order', []);
127 127
         $individual = Individual::getInstance($xref, $tree);
128 128
 
129 129
         $this->checkIndividualAccess($individual, true);
@@ -184,7 +184,7 @@  discard block
 block discarded – undo
184 184
     public function reorderSpousesAction(Request $request, Tree $tree): Response
185 185
     {
186 186
         $xref       = $request->get('xref');
187
-        $order      = (array)$request->get('order', []);
187
+        $order      = (array) $request->get('order', []);
188 188
         $individual = Individual::getInstance($xref, $tree);
189 189
 
190 190
         $this->checkIndividualAccess($individual, true);
@@ -291,7 +291,7 @@  discard block
 block discarded – undo
291 291
                 $gedcom .= $this->addNewFact($request, $tree, $match);
292 292
             }
293 293
         }
294
-        if ((bool)$request->get('SOUR_INDI')) {
294
+        if ((bool) $request->get('SOUR_INDI')) {
295 295
             $gedcom = $this->handleUpdates($gedcom);
296 296
         } else {
297 297
             $gedcom = $this->updateRest($gedcom);
@@ -383,7 +383,7 @@  discard block
 block discarded – undo
383 383
                 $gedcom .= $this->addNewFact($request, $tree, $match);
384 384
             }
385 385
         }
386
-        if ((bool)$request->get('SOUR_INDI')) {
386
+        if ((bool) $request->get('SOUR_INDI')) {
387 387
             $gedcom = $this->handleUpdates($gedcom);
388 388
         } else {
389 389
             $gedcom = $this->updateRest($gedcom);
@@ -416,7 +416,7 @@  discard block
 block discarded – undo
416 416
      */
417 417
     public function addSpouse(Request $request, Tree $tree): Response
418 418
     {
419
-        $xref   = $request->get('xref', '');
419
+        $xref = $request->get('xref', '');
420 420
 
421 421
         $individual = Individual::getInstance($xref, $tree);
422 422
 
@@ -474,7 +474,7 @@  discard block
 block discarded – undo
474 474
                 $indi_gedcom .= $this->addNewFact($request, $tree, $match);
475 475
             }
476 476
         }
477
-        if ((bool)$request->get('SOUR_INDI')) {
477
+        if ((bool) $request->get('SOUR_INDI')) {
478 478
             $indi_gedcom = $this->handleUpdates($indi_gedcom);
479 479
         } else {
480 480
             $indi_gedcom = $this->updateRest($indi_gedcom);
@@ -486,7 +486,7 @@  discard block
 block discarded – undo
486 486
                 $fam_gedcom .= $this->addNewFact($request, $tree, $match);
487 487
             }
488 488
         }
489
-        if ((bool)$request->get('SOUR_FAM')) {
489
+        if ((bool) $request->get('SOUR_FAM')) {
490 490
             $fam_gedcom = $this->handleUpdates($fam_gedcom);
491 491
         } else {
492 492
             $fam_gedcom = $this->updateRest($fam_gedcom);
@@ -560,7 +560,7 @@  discard block
 block discarded – undo
560 560
                 $gedrec .= $this->addNewFact($request, $tree, $match);
561 561
             }
562 562
         }
563
-        if ((bool)$request->get('SOUR_INDI')) {
563
+        if ((bool) $request->get('SOUR_INDI')) {
564 564
             $gedrec = $this->handleUpdates($gedrec);
565 565
         } else {
566 566
             $gedrec = $this->updateRest($gedrec);
Please login to merge, or discard this patch.
app/Module/YahrzeitModule.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -68,7 +68,7 @@  discard block
 block discarded – undo
68 68
 
69 69
         $calendar_service = new CalendarService();
70 70
 
71
-        $days      = (int)$this->getBlockSetting($block_id, 'days', self::DEFAULT_DAYS);
71
+        $days      = (int) $this->getBlockSetting($block_id, 'days', self::DEFAULT_DAYS);
72 72
         $infoStyle = $this->getBlockSetting($block_id, 'infoStyle', self::DEFAULT_STYLE);
73 73
         $calendar  = $this->getBlockSetting($block_id, 'calendar', self::DEFAULT_CALENDAR);
74 74
 
@@ -122,7 +122,7 @@  discard block
 block discarded – undo
122 122
                         }
123 123
                         $yahrzeit_date = new Date($yahrzeit_date->format('%@ %A %O %E'));
124 124
 
125
-                        $yahrzeits[] = (object)[
125
+                        $yahrzeits[] = (object) [
126 126
                             'individual'    => $fact->getParent(),
127 127
                             'fact_date'     => $fact->getDate(),
128 128
                             'fact'          => $fact,
Please login to merge, or discard this patch.
app/Module/UpcomingAnniversariesModule.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -118,7 +118,7 @@  discard block
 block discarded – undo
118 118
         $default_events = implode(',', self::DEFAULT_EVENTS);
119 119
 
120 120
         $days      = $this->getBlockSetting($block_id, 'days', self::DEFAULT_DAYS);
121
-        $filter    = (bool)$this->getBlockSetting($block_id, 'filter', self::DEFAULT_FILTER);
121
+        $filter    = (bool) $this->getBlockSetting($block_id, 'filter', self::DEFAULT_FILTER);
122 122
         $infoStyle = $this->getBlockSetting($block_id, 'infoStyle', self::DEFAULT_STYLE);
123 123
         $sortStyle = $this->getBlockSetting($block_id, 'sortStyle', self::DEFAULT_SORT);
124 124
         $events    = $this->getBlockSetting($block_id, 'events', $default_events);
@@ -136,7 +136,7 @@  discard block
 block discarded – undo
136 136
         $events_filter = implode('|', $event_array);
137 137
 
138 138
         $startjd = WT_CLIENT_JD + 1;
139
-        $endjd   = WT_CLIENT_JD + (int)$days;
139
+        $endjd   = WT_CLIENT_JD + (int) $days;
140 140
 
141 141
         $facts = $calendar_service->getEventsList($startjd, $endjd, $events_filter, $filter, $sortStyle, $tree);
142 142
 
Please login to merge, or discard this patch.
app/Tree.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -294,7 +294,7 @@
 block discarded – undo
294 294
     public static function getAll(): array
295 295
     {
296 296
         if (empty(self::$trees)) {
297
-            $rows        = Database::prepare(
297
+            $rows = Database::prepare(
298 298
                 "SELECT g.gedcom_id AS tree_id, g.gedcom_name AS tree_name, gs1.setting_value AS tree_title" .
299 299
                 " FROM `##gedcom` g" .
300 300
                 " LEFT JOIN `##gedcom_setting`      gs1 ON (g.gedcom_id=gs1.gedcom_id AND gs1.setting_name='title')" .
Please login to merge, or discard this patch.
app/Services/CalendarService.php 2 patches
Indentation   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -327,9 +327,9 @@
 block discarded – undo
327 327
 
328 328
             // Now fetch these anniversaries
329 329
             foreach ([
330
-                         'INDI' => $ind_sql . $where . $order_by,
331
-                         'FAM'  => $fam_sql . $where . $order_by,
332
-                     ] as $type => $sql) {
330
+                            'INDI' => $ind_sql . $where . $order_by,
331
+                            'FAM'  => $fam_sql . $where . $order_by,
332
+                        ] as $type => $sql) {
333 333
                 $rows = Database::prepare($sql)->execute($args)->fetchAll();
334 334
                 foreach ($rows as $row) {
335 335
                     if ($type === 'INDI') {
Please login to merge, or discard this patch.
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -183,7 +183,7 @@  discard block
 block discarded – undo
183 183
                 "SELECT DISTINCT f_id AS xref, f_gedcom AS gedcom, d_type, d_day, d_month, d_year, d_fact" .
184 184
                 " FROM `##dates` JOIN `##families` ON d_gid = f_id AND d_file = f_file" .
185 185
                 " WHERE d_type = :type AND d_file = :tree_id";
186
-            $args    = [
186
+            $args = [
187 187
                 'type'    => $anniv->format('%@'),
188 188
                 'tree_id' => $tree->getTreeId(),
189 189
             ];
@@ -213,7 +213,7 @@  discard block
 block discarded – undo
213 213
                     $where       .= " AND d_day = :day";
214 214
                     $args['day'] = $anniv->d;
215 215
                 }
216
-                $where         .= " AND d_mon = :month";
216
+                $where .= " AND d_mon = :month";
217 217
                 $args['month'] = $anniv->m;
218 218
             } else {
219 219
                 // SPECIAL CASES:
@@ -227,7 +227,7 @@  discard block
 block discarded – undo
227 227
                         } elseif ($anniv->d === 29 && $anniv->daysInMonth() === 29) {
228 228
                             $where .= " AND (d_day = 29 OR d_day > 30) AND d_mon = 2";
229 229
                         } else {
230
-                            $where       .= " AND d_day = :day AND d_mon = 2";
230
+                            $where .= " AND d_day = :day AND d_mon = 2";
231 231
                             $args['day'] = $anniv->d;
232 232
                         }
233 233
                         break;
@@ -250,7 +250,7 @@  discard block
 block discarded – undo
250 250
                         } elseif ($anniv->d == 29 && $anniv->daysInMonth() === 29) {
251 251
                             $where .= " AND (d_day = 29 OR d_day > 30) AND d_mon = 3";
252 252
                         } else {
253
-                            $where       .= " AND d_day = :day AND d_mon = 3";
253
+                            $where .= " AND d_day = :day AND d_mon = 3";
254 254
                             $args['day'] = $anniv->d;
255 255
                         }
256 256
                         break;
@@ -305,7 +305,7 @@  discard block
 block discarded – undo
305 305
                 }
306 306
             }
307 307
             // Only events in the past (includes dates without a year)
308
-            $where        .= " AND d_year <= :year";
308
+            $where .= " AND d_year <= :year";
309 309
             $args['year'] = $anniv->y;
310 310
 
311 311
             if ($facts) {
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/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.
app/Http/Controllers/SetupController.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -47,7 +47,7 @@  discard block
 block discarded – undo
47 47
     {
48 48
         \define('WT_LOCALE', I18N::init('en-US'));
49 49
 
50
-        $step     = (int)$request->get('step', '1');
50
+        $step     = (int) $request->get('step', '1');
51 51
         $errors   = $this->serverErrors();
52 52
         $warnings = $this->serverWarnings();
53 53
         $data     = $this->extractParameters($request);
@@ -364,7 +364,7 @@  discard block
 block discarded – undo
364 364
      */
365 365
     private function maxExecutionTime(): int
366 366
     {
367
-        return (int)ini_get('max_execution_time');
367
+        return (int) ini_get('max_execution_time');
368 368
     }
369 369
 
370 370
     /**
@@ -397,7 +397,7 @@  discard block
 block discarded – undo
397 397
                 $memory_limit = $memory_limit / 1024 / 1024;
398 398
         }
399 399
 
400
-        return (int)$memory_limit;
400
+        return (int) $memory_limit;
401 401
     }
402 402
 
403 403
     /**
@@ -454,11 +454,11 @@  discard block
 block discarded – undo
454 454
             /* I18N: a program feature */
455 455
             'simplexml' => I18N::translate('reporting'),
456 456
         ];
457
-        $settings   = [
457
+        $settings = [
458 458
             /* I18N: a program feature */
459 459
             'file_uploads' => I18N::translate('file upload capability'),
460 460
         ];
461
-        $warnings   = [];
461
+        $warnings = [];
462 462
 
463 463
         foreach ($extensions as $extension => $features) {
464 464
             if (!\extension_loaded($extension)) {
Please login to merge, or discard this patch.