Passed
Pull Request — main (#4000)
by Jonathan
07:03
created
app/Http/RequestHandlers/AutoCompleteFolder.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -56,7 +56,7 @@
 block discarded – undo
56 56
 
57 57
         try {
58 58
             return $this->media_file_service->mediaFolders($tree)
59
-                ->filter(fn (string $path): bool => stripos($path, $query) !== false);
59
+                ->filter(fn(string $path): bool => stripos($path, $query) !== false);
60 60
         } catch (FilesystemException $ex) {
61 61
             return new Collection();
62 62
         }
Please login to merge, or discard this patch.
app/Services/MediaFileService.php 1 patch
Spacing   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -98,7 +98,7 @@  discard block
 block discarded – undo
98 98
         $sizePostMax = $this->parseIniFileSize(ini_get('post_max_size'));
99 99
         $sizeUploadMax = $this->parseIniFileSize(ini_get('upload_max_filesize'));
100 100
 
101
-        $bytes =  min($sizePostMax, $sizeUploadMax);
101
+        $bytes = min($sizePostMax, $sizeUploadMax);
102 102
         $kb    = intdiv($bytes + 1023, 1024);
103 103
 
104 104
         return I18N::translate('%s KB', I18N::number($kb));
@@ -297,9 +297,9 @@  discard block
 block discarded – undo
297 297
         try {
298 298
             $files = $filesystem
299 299
                 ->listContents($folder, $subfolders)
300
-                ->filter(fn (StorageAttributes $attributes): bool => $attributes->isFile())
301
-                ->filter(fn (StorageAttributes $attributes): bool => !$this->ignorePath($attributes->path()))
302
-                ->map(fn (StorageAttributes $attributes): string => $attributes->path())
300
+                ->filter(fn(StorageAttributes $attributes): bool => $attributes->isFile())
301
+                ->filter(fn(StorageAttributes $attributes): bool => !$this->ignorePath($attributes->path()))
302
+                ->map(fn(StorageAttributes $attributes): string => $attributes->path())
303 303
                 ->toArray();
304 304
         } catch (FilesystemException $ex) {
305 305
             $files = [];
@@ -347,9 +347,9 @@  discard block
 block discarded – undo
347 347
     {
348 348
         $folders = Registry::filesystem()->media($tree)
349 349
             ->listContents('', Filesystem::LIST_DEEP)
350
-            ->filter(fn (StorageAttributes $attributes): bool => $attributes->isDir())
351
-            ->filter(fn (StorageAttributes $attributes): bool => !$this->ignorePath($attributes->path()))
352
-            ->map(fn (StorageAttributes $attributes): string => $attributes->path())
350
+            ->filter(fn(StorageAttributes $attributes): bool => $attributes->isDir())
351
+            ->filter(fn(StorageAttributes $attributes): bool => !$this->ignorePath($attributes->path()))
352
+            ->map(fn(StorageAttributes $attributes): string => $attributes->path())
353 353
             ->toArray();
354 354
 
355 355
         return new Collection($folders);
@@ -394,9 +394,9 @@  discard block
 block discarded – undo
394 394
         foreach ($media_roots as $media_folder) {
395 395
             $tmp = $data_filesystem
396 396
                 ->listContents($media_folder, Filesystem::LIST_DEEP)
397
-                ->filter(fn (StorageAttributes $attributes): bool => $attributes->isDir())
398
-                ->filter(fn (StorageAttributes $attributes): bool => !$this->ignorePath($attributes->path()))
399
-                ->map(fn (StorageAttributes $attributes): string => $attributes->path() . '/')
397
+                ->filter(fn(StorageAttributes $attributes): bool => $attributes->isDir())
398
+                ->filter(fn(StorageAttributes $attributes): bool => !$this->ignorePath($attributes->path()))
399
+                ->map(fn(StorageAttributes $attributes): string => $attributes->path() . '/')
400 400
                 ->toArray();
401 401
 
402 402
             $disk_folders = $disk_folders->concat($tmp);
Please login to merge, or discard this patch.
app/Services/GedcomEditService.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -438,12 +438,12 @@  discard block
 block discarded – undo
438 438
     {
439 439
         $subtags = Registry::elementFactory()->make($record->tag())->subtags();
440 440
 
441
-        $subtags = array_filter($subtags, fn (string $v, string $k) => !str_ends_with($v, ':1') || $record->facts([$k])->isEmpty(), ARRAY_FILTER_USE_BOTH);
441
+        $subtags = array_filter($subtags, fn(string $v, string $k) => !str_ends_with($v, ':1') || $record->facts([$k])->isEmpty(), ARRAY_FILTER_USE_BOTH);
442 442
 
443 443
         $subtags = array_keys($subtags);
444 444
 
445 445
         if (!$include_hidden) {
446
-            $fn_hidden = fn (string $t): bool => !$this->isHiddenTag($record->tag() . ':' . $t);
446
+            $fn_hidden = fn(string $t): bool => !$this->isHiddenTag($record->tag() . ':' . $t);
447 447
             $subtags   = array_filter($subtags, $fn_hidden);
448 448
         }
449 449
 
@@ -536,7 +536,7 @@  discard block
 block discarded – undo
536 536
     private function isHiddenTag(string $tag): bool
537 537
     {
538 538
         // Function to filter hidden tags.
539
-        $fn_hide = fn (string $x): bool => (bool) Site::getPreference('HIDE_' . $x);
539
+        $fn_hide = fn(string $x): bool => (bool) Site::getPreference('HIDE_' . $x);
540 540
 
541 541
         $preferences = array_filter(Gedcom::HIDDEN_TAGS, $fn_hide, ARRAY_FILTER_USE_KEY);
542 542
         $preferences = array_values($preferences);
Please login to merge, or discard this patch.
app/Functions/FunctionsPrint.php 1 patch
Spacing   +12 added lines, -12 removed lines patch added patch discarded remove patch
@@ -161,7 +161,7 @@  discard block
 block discarded – undo
161 161
                     if ($note->canShow()) {
162 162
                         $noterec = $note->gedcom();
163 163
                         $nt      = preg_match("/0 @$nmatch[1]@ NOTE (.*)/", $noterec, $n1match);
164
-                        $data    .= self::printNoteRecord($tree, $nt > 0 ? $n1match[1] : '', 1, $noterec);
164
+                        $data .= self::printNoteRecord($tree, $nt > 0 ? $n1match[1] : '', 1, $noterec);
165 165
                     }
166 166
                 } else {
167 167
                     $data = '<div class="fact_NOTE"><span class="label">' . I18N::translate('Note') . '</span>: <span class="field error">' . $nmatch[1] . '</span></div>';
@@ -379,7 +379,7 @@  discard block
 block discarded – undo
379 379
                 if (preg_match_all('/\n3 (?:_HEB|ROMN) (.+)/', $placerec, $matches)) {
380 380
                     foreach ($matches[1] as $match) {
381 381
                         $wt_place = new Place($match, $tree);
382
-                        $html     .= ' - ' . $wt_place->fullName();
382
+                        $html .= ' - ' . $wt_place->fullName();
383 383
                     }
384 384
                 }
385 385
 
@@ -393,7 +393,7 @@  discard block
 block discarded – undo
393 393
                     // Links to external maps
394 394
                     $html .= app(ModuleService::class)
395 395
                         ->findByInterface(ModuleMapLinkInterface::class)
396
-                        ->map(fn (ModuleMapLinkInterface $module): string => ' ' . $module->mapLink($event))
396
+                        ->map(fn(ModuleMapLinkInterface $module): string => ' ' . $module->mapLink($event))
397 397
                         ->implode('');
398 398
                 }
399 399
 
@@ -440,7 +440,7 @@  discard block
 block discarded – undo
440 440
                 $quick_facts  = explode(',', $tree->getPreference('INDI_FACTS_QUICK'));
441 441
                 $unique_facts = [
442 442
                     'ADOP',
443
-                    'AFN' ,
443
+                    'AFN',
444 444
                     'BAPL',
445 445
                     'BAPM',
446 446
                     'BARM',
@@ -449,7 +449,7 @@  discard block
 block discarded – undo
449 449
                     'BURI',
450 450
                     'CAST',
451 451
                     'CHAN',
452
-                    'CHR' ,
452
+                    'CHR',
453 453
                     'CHRA',
454 454
                     'CONF',
455 455
                     'CONL',
@@ -459,18 +459,18 @@  discard block
 block discarded – undo
459 459
                     'FCOM',
460 460
                     'GRAD',
461 461
                     'NCHI',
462
-                    'NMR' ,
462
+                    'NMR',
463 463
                     'ORDN',
464 464
                     'PROB',
465 465
                     'REFN',
466 466
                     'RELI',
467 467
                     'RESN',
468 468
                     'RETI',
469
-                    'RFN' ,
470
-                    'RIN' ,
471
-                    'SEX' ,
469
+                    'RFN',
470
+                    'RIN',
471
+                    'SEX',
472 472
                     'SLGC',
473
-                    'SSN' ,
473
+                    'SSN',
474 474
                     'WILL',
475 475
                 ];
476 476
                 break;
@@ -492,13 +492,13 @@  discard block
 block discarded – undo
492 492
         }
493 493
 
494 494
         // Filter existing tags
495
-        $filter_fn = fn ($tag): bool => !in_array($tag, $unique_facts, true) || $record->facts([$tag])->isEmpty();
495
+        $filter_fn = fn($tag): bool => !in_array($tag, $unique_facts, true) || $record->facts([$tag])->isEmpty();
496 496
 
497 497
         $quick_facts = array_filter($quick_facts, $filter_fn);
498 498
 
499 499
 
500 500
         // Create a label for a subtag
501
-        $label_fn = fn ($subtag): string => Registry::elementFactory()->make($record->tag() . ':' . $subtag)->label();
501
+        $label_fn = fn($subtag): string => Registry::elementFactory()->make($record->tag() . ':' . $subtag)->label();
502 502
 
503 503
         $quick_facts = array_combine($quick_facts, array_map($label_fn, $quick_facts));
504 504
         $add_facts   = array_combine($add_facts, array_map($label_fn, $add_facts));
Please login to merge, or discard this patch.
app/Functions/FunctionsRtl.php 1 patch
Spacing   +11 added lines, -11 removed lines patch added patch discarded remove patch
@@ -186,7 +186,7 @@  discard block
 block discarded – undo
186 186
                         $currentLen        = $endPos + 2;
187 187
                         $directive         = substr($workingText, 0, $currentLen);
188 188
                         $workingText       = substr($workingText, $currentLen);
189
-                        $result            .= self::$waitingText . $directive;
189
+                        $result .= self::$waitingText . $directive;
190 190
                         self::$waitingText = '';
191 191
                         break;
192 192
                     }
@@ -299,7 +299,7 @@  discard block
 block discarded – undo
299 299
                         if ($openParIndex !== false) {
300 300
                             // Opening parentheses always inherit the following directionality
301 301
                             self::$waitingText .= $currentLetter;
302
-                            $workingText       = substr($workingText, $currentLen);
302
+                            $workingText = substr($workingText, $currentLen);
303 303
                             while (true) {
304 304
                                 if ($workingText === '') {
305 305
                                     break;
@@ -307,13 +307,13 @@  discard block
 block discarded – undo
307 307
                                 if (substr($workingText, 0, 1) === ' ') {
308 308
                                     // Spaces following this left parenthesis inherit the following directionality too
309 309
                                     self::$waitingText .= ' ';
310
-                                    $workingText       = substr($workingText, 1);
310
+                                    $workingText = substr($workingText, 1);
311 311
                                     continue;
312 312
                                 }
313 313
                                 if (substr($workingText, 0, 6) === '&nbsp;') {
314 314
                                     // Spaces following this left parenthesis inherit the following directionality too
315 315
                                     self::$waitingText .= '&nbsp;';
316
-                                    $workingText       = substr($workingText, 6);
316
+                                    $workingText = substr($workingText, 6);
317 317
                                     continue;
318 318
                                 }
319 319
                                 break;
@@ -330,9 +330,9 @@  discard block
 block discarded – undo
330 330
                         // Exceptions to this rule will be handled later during final clean-up.
331 331
                         //
332 332
                         self::$waitingText .= $currentLetter;
333
-                        $workingText       = substr($workingText, $currentLen);
333
+                        $workingText = substr($workingText, $currentLen);
334 334
                         if (self::$currentState !== '') {
335
-                            $result            .= self::$waitingText;
335
+                            $result .= self::$waitingText;
336 336
                             self::$waitingText = '';
337 337
                         }
338 338
                         break 2; // double break because we're waiting for more information
@@ -463,7 +463,7 @@  discard block
 block discarded – undo
463 463
                 }
464 464
                 if (substr($result . "\n", 0, self::LENGTH_START) !== self::START_LTR && substr($result . "\n", 0, self::LENGTH_START) !== self::START_RTL) {
465 465
                     $leadingText .= substr($result, 0, 1);
466
-                    $result      = substr($result, 1);
466
+                    $result = substr($result, 1);
467 467
                     continue;
468 468
                 }
469 469
                 $result = substr($result, 0, self::LENGTH_START) . $leadingText . substr($result, self::LENGTH_START);
@@ -600,11 +600,11 @@  discard block
 block discarded – undo
600 600
     public static function breakCurrentSpan(string &$result): void
601 601
     {
602 602
         // Interrupt the current span, insert that <br>, and then continue the current span
603
-        $result            .= self::$waitingText;
603
+        $result .= self::$waitingText;
604 604
         self::$waitingText = '';
605 605
 
606 606
         $breakString = '<' . self::$currentState . 'br>';
607
-        $result      .= $breakString;
607
+        $result .= $breakString;
608 608
     }
609 609
 
610 610
     /**
@@ -661,7 +661,7 @@  discard block
 block discarded – undo
661 661
                 break;
662 662
             } // No more numeric strings
663 663
 
664
-            $tempResult    .= substr($textSpan, 0, $posLRE + 3); // Copy everything preceding the numeric string
664
+            $tempResult .= substr($textSpan, 0, $posLRE + 3); // Copy everything preceding the numeric string
665 665
             $numericString = substr($textSpan, $posLRE + 3, $posPDF - $posLRE); // Separate the entire numeric string
666 666
             $textSpan      = substr($textSpan, $posPDF + 3);
667 667
             $posColon      = strpos($numericString, ':');
@@ -1128,7 +1128,7 @@  discard block
 block discarded – undo
1128 1128
 
1129 1129
             // We're done: finish the span
1130 1130
             $textSpan = self::starredName($textSpan, 'RTL'); // Wrap starred name in <u> and </u> tags
1131
-            $result   .= $textSpan . self::END_RTL;
1131
+            $result .= $textSpan . self::END_RTL;
1132 1132
         }
1133 1133
 
1134 1134
         if (self::$currentState !== 'LTR' && self::$currentState !== 'RTL') {
Please login to merge, or discard this patch.
app/Functions/FunctionsPrintLists.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -49,8 +49,8 @@
 block discarded – undo
49 49
      */
50 50
     public static function surnameTagCloud(array $surnames, ?ModuleListInterface $module, bool $totals, Tree $tree): string
51 51
     {
52
-        $maximum = max(array_map(static fn (array $x): int => max($x), $surnames));
53
-        $minimum = min(array_map(static fn (array $x): int => min($x), $surnames));
52
+        $maximum = max(array_map(static fn(array $x) : int => max($x), $surnames));
53
+        $minimum = min(array_map(static fn(array $x): int => min($x), $surnames));
54 54
 
55 55
         $tag_cloud = '';
56 56
 
Please login to merge, or discard this patch.
app/Http/RequestHandlers/ManageMediaData.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -244,7 +244,7 @@  discard block
 block discarded – undo
244 244
                     $create_form = '';
245 245
                     foreach ($media_trees as $media_tree => $media_directory) {
246 246
                         if (str_starts_with($row[0], $media_directory)) {
247
-                            $tmp         = substr($row[0], strlen($media_directory));
247
+                            $tmp = substr($row[0], strlen($media_directory));
248 248
                             $create_form .=
249 249
                                 '<p><a href="#" data-bs-toggle="modal" data-bs-backdrop="static" data-bs-target="#modal-create-media-from-file" data-file="' . e($tmp) . '" data-url="' . e(route(CreateMediaObjectFromFile::class, ['tree' => $media_tree])) . '" onclick="document.getElementById(\'modal-create-media-from-file-form\').action=this.dataset.url; document.getElementById(\'file\').value=this.dataset.file;">' . I18N::translate('Create') . '</a> — ' . e($media_tree) . '<p>';
250 250
                         }
@@ -349,7 +349,7 @@  discard block
 block discarded – undo
349 349
                 // This will work for local filesystems.  For remote filesystems, we will
350 350
                 // need to copy the file locally to work out the image size.
351 351
                 $imgsize = getimagesizefromstring($data_filesystem->read($file));
352
-                $html    .= '<dt>' . I18N::translate('Image dimensions') . '</dt>';
352
+                $html .= '<dt>' . I18N::translate('Image dimensions') . '</dt>';
353 353
                 /* I18N: image dimensions, width × height */
354 354
                 $html .= '<dd>' . I18N::translate('%1$s × %2$s pixels', I18N::number($imgsize['0']), I18N::number($imgsize['1'])) . '</dd>';
355 355
             } catch (FilesystemException | UnableToReadFile | Throwable $ex) {
Please login to merge, or discard this patch.
app/Module/FanChartModule.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -80,7 +80,7 @@  discard block
 block discarded – undo
80 80
 {
81 81
     use ModuleChartTrait;
82 82
 
83
-    protected const ROUTE_URL  = '/tree/{tree}/fan-chart-{style}-{generations}-{width}/{xref}';
83
+    protected const ROUTE_URL = '/tree/{tree}/fan-chart-{style}-{generations}-{width}/{xref}';
84 84
 
85 85
     // Chart styles
86 86
     private const STYLE_HALF_CIRCLE          = '2';
@@ -432,7 +432,7 @@  discard block
 block discarded – undo
432 432
                     ]);
433 433
 
434 434
                     $text_lines = array_map(
435
-                        fn (string $line): string => $this->fitTextToPixelWidth($line, $max_text_length),
435
+                        fn(string $line): string => $this->fitTextToPixelWidth($line, $max_text_length),
436 436
                         $text_lines
437 437
                     );
438 438
 
@@ -488,13 +488,13 @@  discard block
 block discarded – undo
488 488
 
489 489
                     foreach ($theme->individualBoxMenu($individual) as $menu) {
490 490
                         $link  = $menu->getLink();
491
-                        $class =  $menu->getClass();
491
+                        $class = $menu->getClass();
492 492
                         $html .= '<a href="' . e($link) . '" class="dropdown-item p-1 ' . e($class) . '">';
493 493
                         $html .= $menu->getLabel();
494 494
                         $html .= '</a>';
495 495
                     }
496 496
 
497
-                    $html  .= '</div>';
497
+                    $html .= '</div>';
498 498
                 }
499 499
             }
500 500
         }
Please login to merge, or discard this patch.
app/Report/HtmlRenderer.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -726,7 +726,7 @@
 block discarded – undo
726 726
 
727 727
         $lines = explode("\n", $str);
728 728
 
729
-        $lines = array_map(fn (string $string): string => $this->utf8WordWrap($string, $line_width), $lines);
729
+        $lines = array_map(fn(string $string): string => $this->utf8WordWrap($string, $line_width), $lines);
730 730
 
731 731
         return implode("\n", $lines);
732 732
     }
Please login to merge, or discard this patch.