Passed
Pull Request — main (#5039)
by Bernard
07:56
created
app/Individual.php 1 patch
Spacing   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -45,11 +45,11 @@  discard block
 block discarded – undo
45 45
     protected const string ROUTE_NAME = IndividualPage::class;
46 46
 
47 47
     /** Used in some lists to keep track of this individual’s generation in that list */
48
-    public int|null $generation = null;
48
+    public int | null $generation = null;
49 49
 
50
-    private Date|null $estimated_birth_date = null;
50
+    private Date | null $estimated_birth_date = null;
51 51
 
52
-    private Date|null $estimated_death_date = null;
52
+    private Date | null $estimated_death_date = null;
53 53
 
54 54
     /**
55 55
      * A closure which will compare individuals by birth date.
@@ -78,7 +78,7 @@  discard block
 block discarded – undo
78 78
      *
79 79
      * @return bool
80 80
      */
81
-    public function canShowName(int|null $access_level = null): bool
81
+    public function canShowName(int | null $access_level = null): bool
82 82
     {
83 83
         $access_level ??= Auth::accessLevel($this->tree);
84 84
 
@@ -312,7 +312,7 @@  discard block
 block discarded – undo
312 312
     /**
313 313
      * Find the highlighted media object for an individual
314 314
      */
315
-    public function findHighlightedMediaFile(): MediaFile|null
315
+    public function findHighlightedMediaFile(): MediaFile | null
316 316
     {
317 317
         $fact = $this->facts(['OBJE'])
318 318
             ->first(static function (Fact $fact): bool {
@@ -663,7 +663,7 @@  discard block
 block discarded – undo
663 663
      *
664 664
      * @return Collection<int,Family>
665 665
      */
666
-    public function spouseFamilies(int|null $access_level = null): Collection
666
+    public function spouseFamilies(int | null $access_level = null): Collection
667 667
     {
668 668
         $access_level ??= Auth::accessLevel($this->tree);
669 669
 
@@ -690,7 +690,7 @@  discard block
 block discarded – undo
690 690
      *
691 691
      * @return Individual|null
692 692
      */
693
-    public function getCurrentSpouse(): Individual|null
693
+    public function getCurrentSpouse(): Individual | null
694 694
     {
695 695
         $family = $this->spouseFamilies()->last();
696 696
 
@@ -729,7 +729,7 @@  discard block
 block discarded – undo
729 729
      *
730 730
      * @return Collection<int,Family>
731 731
      */
732
-    public function childFamilies(int|null $access_level = null): Collection
732
+    public function childFamilies(int | null $access_level = null): Collection
733 733
     {
734 734
         $access_level ??= Auth::accessLevel($this->tree);
735 735
 
Please login to merge, or discard this patch.
app/User.php 1 patch
Indentation   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -291,8 +291,8 @@
 block discarded – undo
291 291
     public function check2facode(string $code2fa): bool
292 292
     {
293 293
         $secret = DB::table('user')
294
-             ->where('user_id', '=', $this->id())
295
-             ->value('secret');
294
+                ->where('user_id', '=', $this->id())
295
+                ->value('secret');
296 296
         settype($secret, "string");
297 297
         $google2fa = new Google2FA();
298 298
         $googleverifystatus = $google2fa->verifyKey($secret, $code2fa);
Please login to merge, or discard this patch.
app/GedcomRecord.php 1 patch
Spacing   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -78,7 +78,7 @@  discard block
 block discarded – undo
78 78
     protected string $gedcom;
79 79
 
80 80
     // GEDCOM data (after any pending edits)
81
-    protected string|null $pending;
81
+    protected string | null $pending;
82 82
 
83 83
     /** @var array<Fact> Facts extracted from $gedcom/$pending */
84 84
     protected array $facts;
@@ -87,10 +87,10 @@  discard block
 block discarded – undo
87 87
     protected array $getAllNames = [];
88 88
 
89 89
     /** @var int|null Cached result */
90
-    private int|null $getPrimaryName = null;
90
+    private int | null $getPrimaryName = null;
91 91
 
92 92
     /** @var int|null Cached result */
93
-    private int|null $getSecondaryName = null;
93
+    private int | null $getSecondaryName = null;
94 94
 
95 95
     /**
96 96
      * Create a GedcomRecord object from raw GEDCOM data.
@@ -101,7 +101,7 @@  discard block
 block discarded – undo
101 101
      *                             empty string for records with pending deletions
102 102
      * @param Tree        $tree
103 103
      */
104
-    public function __construct(string $xref, string $gedcom, string|null $pending, Tree $tree)
104
+    public function __construct(string $xref, string $gedcom, string | null $pending, Tree $tree)
105 105
     {
106 106
         $this->xref    = $xref;
107 107
         $this->gedcom  = $gedcom;
@@ -240,7 +240,7 @@  discard block
 block discarded – undo
240 240
      *
241 241
      * @return bool
242 242
      */
243
-    public function canShow(int|null $access_level = null): bool
243
+    public function canShow(int | null $access_level = null): bool
244 244
     {
245 245
         $access_level ??= Auth::accessLevel($this->tree);
246 246
 
@@ -262,7 +262,7 @@  discard block
 block discarded – undo
262 262
      *
263 263
      * @return bool
264 264
      */
265
-    public function canShowName(int|null $access_level = null): bool
265
+    public function canShowName(int | null $access_level = null): bool
266 266
     {
267 267
         return $this->canShow($access_level);
268 268
     }
@@ -312,7 +312,7 @@  discard block
 block discarded – undo
312 312
         }
313 313
 
314 314
         // Remove links to missing and private records
315
-        $pattern =  '/\n(\d) ' . Gedcom::REGEX_TAG . ' @(' . Gedcom::REGEX_XREF . ')@/';
315
+        $pattern = '/\n(\d) ' . Gedcom::REGEX_TAG . ' @(' . Gedcom::REGEX_XREF . ')@/';
316 316
         preg_match_all($pattern, $gedcom, $matches, PREG_SET_ORDER);
317 317
 
318 318
         foreach ($matches as $match) {
@@ -432,7 +432,7 @@  discard block
 block discarded – undo
432 432
      *
433 433
      * @return void
434 434
      */
435
-    public function setPrimaryName(int|null $n = null): void
435
+    public function setPrimaryName(int | null $n = null): void
436 436
     {
437 437
         $this->getPrimaryName   = $n;
438 438
         $this->getSecondaryName = null;
@@ -483,7 +483,7 @@  discard block
 block discarded – undo
483 483
      *
484 484
      * @return string|null
485 485
      */
486
-    public function alternateName(): string|null
486
+    public function alternateName(): string | null
487 487
     {
488 488
         if ($this->canShowName() && $this->getPrimaryName() !== $this->getSecondaryName()) {
489 489
             $all_names = $this->getAllNames();
@@ -611,7 +611,7 @@  discard block
 block discarded – undo
611 611
     public function facts(
612 612
         array $filter = [],
613 613
         bool $sort = false,
614
-        int|null $access_level = null,
614
+        int | null $access_level = null,
615 615
         bool $ignore_deleted = false
616 616
     ): Collection {
617 617
         $access_level ??= Auth::accessLevel($this->tree);
Please login to merge, or discard this patch.
app/SessionDatabaseHandler.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -90,7 +90,7 @@
 block discarded – undo
90 90
 
91 91
             // Only update session once a minute to reduce contention on the session table.
92 92
             if (date('Y-m-d H:i:s', time() - 60) > $this->row->session_time) {
93
-                $updates['session_time'] =  date('Y-m-d H:i:s');
93
+                $updates['session_time'] = date('Y-m-d H:i:s');
94 94
             }
95 95
 
96 96
             if ($updates !== []) {
Please login to merge, or discard this patch.
app/Http/Dispatcher.php 2 patches
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -52,7 +52,7 @@  discard block
 block discarded – undo
52 52
      */
53 53
     private static function reduceMiddleware(
54 54
         RequestHandlerInterface $carry,
55
-        string|MiddlewareInterface $item,
55
+        string | MiddlewareInterface $item,
56 56
     ): RequestHandlerInterface {
57 57
         return new readonly class (carry: $carry, item: $item) implements RequestHandlerInterface {
58 58
             /**
@@ -60,7 +60,7 @@  discard block
 block discarded – undo
60 60
              */
61 61
             public function __construct(
62 62
                 private RequestHandlerInterface $carry,
63
-                private string|MiddlewareInterface $item,
63
+                private string | MiddlewareInterface $item,
64 64
             ) {
65 65
             }
66 66
 
Please login to merge, or discard this patch.
Braces   +2 added lines, -1 removed lines patch added patch discarded remove patch
@@ -54,7 +54,8 @@
 block discarded – undo
54 54
         RequestHandlerInterface $carry,
55 55
         string|MiddlewareInterface $item,
56 56
     ): RequestHandlerInterface {
57
-        return new readonly class (carry: $carry, item: $item) implements RequestHandlerInterface {
57
+        return new readonly class (carry: $carry, item: $item) implements RequestHandlerInterface
58
+        {
58 59
             /**
59 60
              * @param class-string|MiddlewareInterface $item
60 61
              */
Please login to merge, or discard this patch.
app/Services/LinkedRecordService.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -76,7 +76,7 @@  discard block
 block discarded – undo
76 76
     /**
77 77
      * @return Collection<int,Family>
78 78
      */
79
-    public function linkedFamilies(GedcomRecord $record, string|null $link_type = null): Collection
79
+    public function linkedFamilies(GedcomRecord $record, string | null $link_type = null): Collection
80 80
     {
81 81
         $query = DB::table('families')
82 82
             ->join('link', static function (JoinClause $join): void {
@@ -102,7 +102,7 @@  discard block
 block discarded – undo
102 102
     /**
103 103
      * @return Collection<int,Individual>
104 104
      */
105
-    public function linkedIndividuals(GedcomRecord $record, string|null $link_type = null): Collection
105
+    public function linkedIndividuals(GedcomRecord $record, string | null $link_type = null): Collection
106 106
     {
107 107
         $query = DB::table('individuals')
108 108
             ->join('link', static function (JoinClause $join): void {
Please login to merge, or discard this patch.
app/Http/Middleware/BadBotBlocker.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -339,7 +339,7 @@
 block discarded – undo
339 339
         return Registry::cache()->file()->remember('whois-asn-' . $asn, function () use ($asn): array {
340 340
             $ranges = $this->network_service->findIpRangesForAsn($asn);
341 341
 
342
-            $mapper = static fn (string $range): RangeInterface|null => Factory::parseRangeString($range);
342
+            $mapper = static fn (string $range): RangeInterface | null => Factory::parseRangeString($range);
343 343
 
344 344
             $ranges = array_map($mapper, $ranges);
345 345
 
Please login to merge, or discard this patch.
app/Statistics/Repository/MediaRepository.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -172,7 +172,7 @@
 block discarded – undo
172 172
         return $this->totalMedia(self::MEDIA_TYPE_UNKNOWN);
173 173
     }
174 174
 
175
-    public function chartMedia(string|null $color_from = null, string|null $color_to = null): string
175
+    public function chartMedia(string | null $color_from = null, string | null $color_to = null): string
176 176
     {
177 177
         $media = DB::table('media_file')
178 178
             ->where('m_file', '=', $this->tree->id())
Please login to merge, or discard this patch.
app/Statistics/Repository/IndividualRepository.php 1 patch
Spacing   +14 added lines, -14 removed lines patch added patch discarded remove patch
@@ -469,7 +469,7 @@  discard block
 block discarded – undo
469 469
             ->groupBy(['i_sex']);
470 470
     }
471 471
 
472
-    public function statsBirth(string|null $color_from = null, string|null $color_to = null): string
472
+    public function statsBirth(string | null $color_from = null, string | null $color_to = null): string
473 473
     {
474 474
         return (new ChartBirth($this->century_service, $this->color_service, $this->tree))
475 475
             ->chartBirth($color_from, $color_to);
@@ -503,7 +503,7 @@  discard block
 block discarded – undo
503 503
             ->groupBy(['i_sex']);
504 504
     }
505 505
 
506
-    public function statsDeath(string|null $color_from = null, string|null $color_to = null): string
506
+    public function statsDeath(string | null $color_from = null, string | null $color_to = null): string
507 507
     {
508 508
         return (new ChartDeath($this->century_service, $this->color_service, $this->tree))
509 509
             ->chartDeath($color_from, $color_to);
@@ -1160,8 +1160,8 @@  discard block
 block discarded – undo
1160 1160
     }
1161 1161
 
1162 1162
     public function chartCommonGiven(
1163
-        string|null $color_from = null,
1164
-        string|null $color_to = null,
1163
+        string | null $color_from = null,
1164
+        string | null $color_to = null,
1165 1165
         int $maxtoshow = 7
1166 1166
     ): string {
1167 1167
         $tot_indi = $this->totalIndividualsQuery();
@@ -1176,8 +1176,8 @@  discard block
 block discarded – undo
1176 1176
     }
1177 1177
 
1178 1178
     public function chartCommonSurnames(
1179
-        string|null $color_from = null,
1180
-        string|null $color_to = null,
1179
+        string | null $color_from = null,
1180
+        string | null $color_to = null,
1181 1181
         int $number_of_surnames = 10
1182 1182
     ): string {
1183 1183
         $tot_indi     = $this->totalIndividualsQuery();
@@ -1194,7 +1194,7 @@  discard block
 block discarded – undo
1194 1194
             ->chartCommonSurnames($tot_indi, $all_surnames, $color_from, $color_to);
1195 1195
     }
1196 1196
 
1197
-    public function chartMortality(string|null $color_living = null, string|null $color_dead = null): string
1197
+    public function chartMortality(string | null $color_living = null, string | null $color_dead = null): string
1198 1198
     {
1199 1199
         $tot_l = $this->totalLivingQuery();
1200 1200
         $tot_d = $this->totalDeceasedQuery();
@@ -1204,8 +1204,8 @@  discard block
 block discarded – undo
1204 1204
     }
1205 1205
 
1206 1206
     public function chartIndisWithSources(
1207
-        string|null $color_from = null,
1208
-        string|null $color_to = null
1207
+        string | null $color_from = null,
1208
+        string | null $color_to = null
1209 1209
     ): string {
1210 1210
         $tot_indi        = $this->totalIndividualsQuery();
1211 1211
         $tot_indi_source = $this->totalIndisWithSourcesQuery();
@@ -1215,8 +1215,8 @@  discard block
 block discarded – undo
1215 1215
     }
1216 1216
 
1217 1217
     public function chartFamsWithSources(
1218
-        string|null $color_from = null,
1219
-        string|null $color_to = null
1218
+        string | null $color_from = null,
1219
+        string | null $color_to = null
1220 1220
     ): string {
1221 1221
         $tot_fam        = $this->totalFamiliesQuery();
1222 1222
         $tot_fam_source = $this->totalFamsWithSourcesQuery();
@@ -1226,9 +1226,9 @@  discard block
 block discarded – undo
1226 1226
     }
1227 1227
 
1228 1228
     public function chartSex(
1229
-        string|null $color_female = null,
1230
-        string|null $color_male = null,
1231
-        string|null $color_unknown = null
1229
+        string | null $color_female = null,
1230
+        string | null $color_male = null,
1231
+        string | null $color_unknown = null
1232 1232
     ): string {
1233 1233
         $tot_m = $this->totalSexMalesQuery();
1234 1234
         $tot_f = $this->totalSexFemalesQuery();
Please login to merge, or discard this patch.