Passed
Pull Request — main (#5166)
by Bernard
07:26
created
app/SessionDatabaseHandler.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -32,7 +32,7 @@  discard block
 block discarded – undo
32 32
 {
33 33
     private ServerRequestInterface $request;
34 34
 
35
-    private object|null $row = null;
35
+    private object | null $row = null;
36 36
 
37 37
     public function __construct(ServerRequestInterface $request)
38 38
     {
@@ -89,7 +89,7 @@  discard block
 block discarded – undo
89 89
 
90 90
             // Only update session once a minute to reduce contention on the session table.
91 91
             if (date('Y-m-d H:i:s', time() - 60) > $this->row->session_time) {
92
-                $updates['session_time'] =  date('Y-m-d H:i:s');
92
+                $updates['session_time'] = date('Y-m-d H:i:s');
93 93
             }
94 94
 
95 95
             if ($updates !== []) {
Please login to merge, or discard this patch.
app/Validator.php 1 patch
Spacing   +15 added lines, -15 removed lines patch added patch discarded remove patch
@@ -125,7 +125,7 @@  discard block
 block discarded – undo
125 125
      */
126 126
     public function isBetween(int $minimum, int $maximum): self
127 127
     {
128
-        $this->rules[] = static function (int|null $value) use ($minimum, $maximum): int|null {
128
+        $this->rules[] = static function (int | null $value) use ($minimum, $maximum): int | null {
129 129
             if (is_int($value) && $value >= $minimum && $value <= $maximum) {
130 130
                 return $value;
131 131
             }
@@ -143,7 +143,7 @@  discard block
 block discarded – undo
143 143
      */
144 144
     public function isInArray(array $values): self
145 145
     {
146
-        $this->rules[] = static fn (int|string|null $value): int|string|null => in_array($value, $values, true) ? $value : null;
146
+        $this->rules[] = static fn (int | string | null $value): int | string | null => in_array($value, $values, true) ? $value : null;
147 147
 
148 148
         return $this;
149 149
     }
@@ -163,7 +163,7 @@  discard block
 block discarded – undo
163 163
      */
164 164
     public function isNotEmpty(): self
165 165
     {
166
-        $this->rules[] = static fn (string|null $value): string|null => $value !== null && $value !== '' ? $value : null;
166
+        $this->rules[] = static fn (string | null $value): string | null => $value !== null && $value !== '' ? $value : null;
167 167
 
168 168
         return $this;
169 169
     }
@@ -175,7 +175,7 @@  discard block
 block discarded – undo
175 175
     {
176 176
         $base_url = $this->request->getAttribute('base_url', '');
177 177
 
178
-        $this->rules[] = static function (string|null $value) use ($base_url): string|null {
178
+        $this->rules[] = static function (string | null $value) use ($base_url): string | null {
179 179
             if ($value !== null) {
180 180
                 $value_info    = parse_url($value);
181 181
                 $base_url_info = parse_url($base_url);
@@ -204,7 +204,7 @@  discard block
 block discarded – undo
204 204
      */
205 205
     public function isTag(): self
206 206
     {
207
-        $this->rules[] = static function (string|null $value): string|null {
207
+        $this->rules[] = static function (string | null $value): string | null {
208 208
             if ($value !== null && preg_match('/^' . Gedcom::REGEX_TAG . '$/', $value) === 1) {
209 209
                 return $value;
210 210
             }
@@ -247,7 +247,7 @@  discard block
 block discarded – undo
247 247
      *
248 248
      * @return bool
249 249
      */
250
-    public function boolean(string $parameter, bool|null $default = null): bool
250
+    public function boolean(string $parameter, bool | null $default = null): bool
251 251
     {
252 252
         $value = $this->parameters[$parameter] ?? null;
253 253
 
@@ -279,7 +279,7 @@  discard block
 block discarded – undo
279 279
             throw new HttpBadRequestException(I18N::translate('The parameter “%s” is missing.', $parameter));
280 280
         }
281 281
 
282
-        $callback = static fn (array|null $value, Closure $rule): array|null => $rule($value);
282
+        $callback = static fn (array | null $value, Closure $rule): array | null => $rule($value);
283 283
 
284 284
         return array_reduce($this->rules, $callback, $value) ?? [];
285 285
     }
@@ -290,7 +290,7 @@  discard block
 block discarded – undo
290 290
      *
291 291
      * @return float
292 292
      */
293
-    public function float(string $parameter, float|null $default = null): float
293
+    public function float(string $parameter, float | null $default = null): float
294 294
     {
295 295
         $value = $this->parameters[$parameter] ?? null;
296 296
 
@@ -300,7 +300,7 @@  discard block
 block discarded – undo
300 300
             $value = null;
301 301
         }
302 302
 
303
-        $callback = static fn (float|null $value, Closure $rule): float|null => $rule($value);
303
+        $callback = static fn (float | null $value, Closure $rule): float | null => $rule($value);
304 304
 
305 305
         $value = array_reduce($this->rules, $callback, $value) ?? $default;
306 306
 
@@ -317,7 +317,7 @@  discard block
 block discarded – undo
317 317
      *
318 318
      * @return int
319 319
      */
320
-    public function integer(string $parameter, int|null $default = null): int
320
+    public function integer(string $parameter, int | null $default = null): int
321 321
     {
322 322
         $value = $this->parameters[$parameter] ?? null;
323 323
 
@@ -333,7 +333,7 @@  discard block
 block discarded – undo
333 333
             $value = null;
334 334
         }
335 335
 
336
-        $callback = static fn (int|null $value, Closure $rule): int|null => $rule($value);
336
+        $callback = static fn (int | null $value, Closure $rule): int | null => $rule($value);
337 337
 
338 338
         $value = array_reduce($this->rules, $callback, $value) ?? $default;
339 339
 
@@ -366,7 +366,7 @@  discard block
 block discarded – undo
366 366
      *
367 367
      * @return string
368 368
      */
369
-    public function string(string $parameter, string|null $default = null): string
369
+    public function string(string $parameter, string | null $default = null): string
370 370
     {
371 371
         $value = $this->parameters[$parameter] ?? null;
372 372
 
@@ -374,9 +374,9 @@  discard block
 block discarded – undo
374 374
             $value = null;
375 375
         }
376 376
 
377
-        $callback = static fn (string|null $value, Closure $rule): string|null => $rule($value);
377
+        $callback = static fn (string | null $value, Closure $rule): string | null => $rule($value);
378 378
 
379
-        $value =  array_reduce($this->rules, $callback, $value) ?? $default;
379
+        $value = array_reduce($this->rules, $callback, $value) ?? $default;
380 380
 
381 381
         if ($value === null) {
382 382
             throw new HttpBadRequestException(I18N::translate('The parameter “%s” is missing.', $parameter));
@@ -401,7 +401,7 @@  discard block
 block discarded – undo
401 401
         throw new HttpBadRequestException(I18N::translate('The parameter “%s” is missing.', $parameter));
402 402
     }
403 403
 
404
-    public function treeOptional(string $parameter = 'tree'): Tree|null
404
+    public function treeOptional(string $parameter = 'tree'): Tree | null
405 405
     {
406 406
         $value = $this->parameters[$parameter] ?? null;
407 407
 
Please login to merge, or discard this patch.
app/StatisticsData.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -101,7 +101,7 @@  discard block
 block discarded – undo
101 101
         $rows = $query
102 102
             ->groupBy(['n_givn'])
103 103
             ->pluck(new Expression('COUNT(DISTINCT n_id)'), 'n_givn')
104
-            ->map(static fn (int|string $count): int => (int) $count);
104
+            ->map(static fn (int | string $count): int => (int) $count);
105 105
 
106 106
 
107 107
         $given_names = [];
@@ -784,7 +784,7 @@  discard block
 block discarded – undo
784 784
      *
785 785
      * @return object{id:string,year:int,fact:string,type:string}|null
786 786
      */
787
-    private function firstEvent(array $events, bool $ascending): object|null
787
+    private function firstEvent(array $events, bool $ascending): object | null
788 788
     {
789 789
         if ($events === []) {
790 790
             $events = [
@@ -803,7 +803,7 @@  discard block
 block discarded – undo
803 803
             ->orderBy('d_julianday1', $ascending ? 'ASC' : 'DESC')
804 804
             ->limit(1)
805 805
             ->get()
806
-            ->map(static fn (object $row): object => (object) [
806
+            ->map(static fn (object $row) : object => (object) [
807 807
                 'id'   => $row->id,
808 808
                 'year' => (int) $row->year,
809 809
                 'fact' => $row->fact,
@@ -916,14 +916,14 @@  discard block
 block discarded – undo
916 916
         return $date->display();
917 917
     }
918 918
 
919
-    public function isUserLoggedIn(int|null $user_id): bool
919
+    public function isUserLoggedIn(int | null $user_id): bool
920 920
     {
921 921
         return $user_id !== null && DB::table('session')
922 922
             ->where('user_id', '=', $user_id)
923 923
             ->exists();
924 924
     }
925 925
 
926
-    public function latestUserId(): int|null
926
+    public function latestUserId(): int | null
927 927
     {
928 928
         $user_id = DB::table('user')
929 929
             ->select(['user.user_id'])
@@ -1135,7 +1135,7 @@  discard block
 block discarded – undo
1135 1135
     /**
1136 1136
      * @return object{individual:Individual,days:int}|null
1137 1137
      */
1138
-    public function longlifeQuery(string $sex): object|null
1138
+    public function longlifeQuery(string $sex): object | null
1139 1139
     {
1140 1140
         return $this->birthAndDeathQuery($sex)
1141 1141
             ->orderBy('days', 'desc')
Please login to merge, or discard this patch.
resources/lang/en-US/messages.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -1,6 +1,6 @@
 block discarded – undo
1 1
 <?php
2 2
 
3
-return array (
3
+return array(
4 4
   ' but the details are unknown' => ' but the details are unknown',
5 5
   '%H:%i:%s' => '%g:%i:%s %a',
6 6
   '%j %F %Y' => '%F %j, %Y',
Please login to merge, or discard this patch.
app/Cli/Commands/ConfigIni.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -81,10 +81,10 @@
 block discarded – undo
81 81
             'dbcert'       => $this->stringOption(input: $input, name: 'dbcert'),
82 82
             'dbca'         => $this->stringOption(input: $input, name: 'dbca'),
83 83
             'dbverify'     => $this->boolOption(input: $input, name: 'dbverify') ? '1' : '0',
84
-            'tblpfx'       => $this->stringOption(input: $input, name: 'tblpfx'),
85
-            'base_url'     => rtrim(string: $this->stringOption(input: $input, name: 'base-url'), characters: '/'),
86
-            'rewrite_urls' => $this->boolOption(input: $input, name: 'rewrite-urls') ? '1' : '0',
87
-            'block_asn'    => $this->stringOption(input: $input, name: 'block-asn'),
84
+            'tblpfx'       => $this->stringOption(input : $input, name : 'tblpfx'),
85
+            'base_url'     => rtrim(string : $this->stringOption(input : $input, name : 'base-url'), characters : '/'),
86
+            'rewrite_urls' => $this->boolOption(input : $input, name : 'rewrite-urls') ? '1' : '0',
87
+            'block_asn'    => $this->stringOption(input : $input, name : 'block-asn'),
88 88
         ];
89 89
 
90 90
         foreach ($config as $key => $value) {
Please login to merge, or discard this patch.
app/Services/SearchService.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -126,7 +126,7 @@  discard block
 block discarded – undo
126 126
                     ->where('wife_name.n_type', '<>', '_MARNM');
127 127
             });
128 128
 
129
-        $field  = new Expression('COALESCE(' . DB::prefix('husb_name') . ".n_full, '') || COALESCE(" . DB::prefix('wife_name') . ".n_full, '')");
129
+        $field = new Expression('COALESCE(' . DB::prefix('husb_name') . ".n_full, '') || COALESCE(" . DB::prefix('wife_name') . ".n_full, '')");
130 130
 
131 131
         $this->whereTrees($query, 'f_file', $trees);
132 132
         $this->whereSearch($query, $field, $search);
@@ -1068,7 +1068,7 @@  discard block
 block discarded – undo
1068 1068
      * @param Expression<string>|string $column
1069 1069
      * @param array<string>             $search_terms
1070 1070
      */
1071
-    private function whereSearch(Builder $query, Expression|string $column, array $search_terms): void
1071
+    private function whereSearch(Builder $query, Expression | string $column, array $search_terms): void
1072 1072
     {
1073 1073
         foreach ($search_terms as $search_term) {
1074 1074
             $query->where($column, DB::iLike(), '%' . addcslashes($search_term, '\\%_') . '%');
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
@@ -323,7 +323,7 @@
 block discarded – undo
323 323
     {
324 324
         return Registry::cache()->file()->remember('whois-asn-' . $asn, function () use ($asn): array {
325 325
             $ranges = $this->network_service->findIpRangesForAsn($asn);
326
-            $mapper = static fn (string $range): RangeInterface|null => Factory::parseRangeString($range);
326
+            $mapper = static fn (string $range): RangeInterface | null => Factory::parseRangeString($range);
327 327
             $ranges = array_map($mapper, $ranges);
328 328
 
329 329
             return array_filter($ranges);
Please login to merge, or discard this patch.
app/Module/IndividualFactsTabModule.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -115,7 +115,7 @@
 block discarded – undo
115 115
             ->flatten();
116 116
 
117 117
         // Don't show family meta-data tags
118
-        $exclude_facts  = new Collection(['FAM:CHAN', 'FAM:_UID', 'FAM:UID', 'FAM:SUBM']);
118
+        $exclude_facts = new Collection(['FAM:CHAN', 'FAM:_UID', 'FAM:UID', 'FAM:SUBM']);
119 119
         // Don't show tags that are shown in tabs or sidebars
120 120
         $exclude_facts = $exclude_facts->merge($sidebar_facts)->merge($tab_facts);
121 121
 
Please login to merge, or discard this patch.
app/Services/GedcomExportService.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -107,7 +107,7 @@  discard block
 block discarded – undo
107 107
         string $line_endings,
108 108
         string $filename,
109 109
         string $format,
110
-        Collection|null $records = null
110
+        Collection | null $records = null
111 111
     ): ResponseInterface {
112 112
         $access_level = self::ACCESS_LEVELS[$privacy];
113 113
 
@@ -177,9 +177,9 @@  discard block
 block discarded – undo
177 177
         string $encoding = UTF8::NAME,
178 178
         int $access_level = Auth::PRIV_HIDE,
179 179
         string $line_endings = 'CRLF',
180
-        Collection|null $records = null,
181
-        ZipArchive|FilesystemOperator|null $zip_filesystem = null,
182
-        string|null $media_path = null
180
+        Collection | null $records = null,
181
+        ZipArchive | FilesystemOperator | null $zip_filesystem = null,
182
+        string | null $media_path = null
183 183
     ) {
184 184
         $stream = fopen('php://memory', 'wb+');
185 185
 
Please login to merge, or discard this patch.