Passed
Pull Request — main (#5166)
by Bernard
07:26
created
app/Services/ModuleService.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -696,7 +696,7 @@  discard block
 block discarded – undo
696 696
 
697 697
                 return strlen($module_name) <= 30;
698 698
             })
699
-            ->map(static function (string $filename): ModuleCustomInterface|null {
699
+            ->map(static function (string $filename): ModuleCustomInterface | null {
700 700
                 $module = self::load($filename);
701 701
 
702 702
                 if ($module instanceof ModuleCustomInterface) {
@@ -714,7 +714,7 @@  discard block
 block discarded – undo
714 714
     /**
715 715
      * Load a custom module in a static scope, to prevent it from modifying local or object variables.
716 716
      */
717
-    private static function load(string $filename): ModuleInterface|null
717
+    private static function load(string $filename): ModuleInterface | null
718 718
     {
719 719
         try {
720 720
             return include $filename;
@@ -826,7 +826,7 @@  discard block
 block discarded – undo
826 826
     /**
827 827
      * Find a specified module, if it is currently active.
828 828
      */
829
-    public function findByName(string $module_name, bool $include_disabled = false): ModuleInterface|null
829
+    public function findByName(string $module_name, bool $include_disabled = false): ModuleInterface | null
830 830
     {
831 831
         return $this->all($include_disabled)
832 832
             ->first(static fn (ModuleInterface $module): bool => $module->name() === $module_name);
Please login to merge, or discard this patch.
app/Services/UserService.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -45,10 +45,10 @@  discard block
 block discarded – undo
45 45
     /**
46 46
      * Find the user with a specified user_id.
47 47
      */
48
-    public function find(int|null $user_id): User|null
48
+    public function find(int | null $user_id): User | null
49 49
     {
50 50
         return Registry::cache()->array()
51
-            ->remember('user-' . $user_id, static fn (): User|null => DB::table('user')
51
+            ->remember('user-' . $user_id, static fn (): User | null => DB::table('user')
52 52
                 ->where('user_id', '=', $user_id)
53 53
                 ->get()
54 54
                 ->map(User::rowMapper())
@@ -58,7 +58,7 @@  discard block
 block discarded – undo
58 58
     /**
59 59
      * Find the user with a specified email address.
60 60
      */
61
-    public function findByEmail(string $email): User|null
61
+    public function findByEmail(string $email): User | null
62 62
     {
63 63
         return DB::table('user')
64 64
             ->where('email', '=', $email)
@@ -70,7 +70,7 @@  discard block
 block discarded – undo
70 70
     /**
71 71
      * Find the user with a specified user_name or email address.
72 72
      */
73
-    public function findByIdentifier(string $identifier): User|null
73
+    public function findByIdentifier(string $identifier): User | null
74 74
     {
75 75
         return DB::table('user')
76 76
             ->where('user_name', '=', $identifier)
@@ -102,7 +102,7 @@  discard block
 block discarded – undo
102 102
     /**
103 103
      * Find the user with a specified password reset token.
104 104
      */
105
-    public function findByToken(string $token): User|null
105
+    public function findByToken(string $token): User | null
106 106
     {
107 107
         return DB::table('user')
108 108
             ->join('user_setting AS us1', 'us1.user_id', '=', 'user.user_id')
@@ -120,7 +120,7 @@  discard block
 block discarded – undo
120 120
     /**
121 121
      * Find the user with a specified user_name.
122 122
      */
123
-    public function findByUserName(string $user_name): User|null
123
+    public function findByUserName(string $user_name): User | null
124 124
     {
125 125
         return DB::table('user')
126 126
             ->where('user_name', '=', $user_name)
Please login to merge, or discard this patch.
app/Http/RequestHandlers/DataFixUpdateAll.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -89,8 +89,8 @@
 block discarded – undo
89 89
 
90 90
         /** @var Collection<int,GedcomRecord> $records */
91 91
         $records = $rows
92
-            ->map(fn (object $row): GedcomRecord|null => $this->data_fix_service->getRecordByType($row->xref, $tree, $row->type))
93
-            ->filter(static fn (GedcomRecord|null $record): bool => $record instanceof GedcomRecord && !$record->isPendingDeletion() && $module->doesRecordNeedUpdate($record, $params));
92
+            ->map(fn (object $row): GedcomRecord | null => $this->data_fix_service->getRecordByType($row->xref, $tree, $row->type))
93
+            ->filter(static fn (GedcomRecord | null $record): bool => $record instanceof GedcomRecord && !$record->isPendingDeletion() && $module->doesRecordNeedUpdate($record, $params));
94 94
 
95 95
         foreach ($records as $record) {
96 96
             $module->updateRecord($record, $params);
Please login to merge, or discard this patch.
app/Module/ListsMenuModule.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -81,10 +81,10 @@
 block discarded – undo
81 81
      *
82 82
      * @return Menu|null
83 83
      */
84
-    public function getMenu(Tree $tree): Menu|null
84
+    public function getMenu(Tree $tree): Menu | null
85 85
     {
86 86
         $submenus = $this->module_service->findByComponent(ModuleListInterface::class, $tree, Auth::user())
87
-            ->map(static fn (ModuleListInterface $module): Menu|null => $module->listMenu($tree))
87
+            ->map(static fn (ModuleListInterface $module): Menu | null => $module->listMenu($tree))
88 88
             ->filter()
89 89
             ->sort(static fn (Menu $x, Menu $y): int => I18N::comparator()($x->getLabel(), $y->getLabel()));
90 90
 
Please login to merge, or discard this patch.
app/Module/TimelineChartModule.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -160,7 +160,7 @@  discard block
 block discarded – undo
160 160
         // Find the requested individuals.
161 161
         $individuals = (new Collection($xrefs))
162 162
             ->uniqueStrict()
163
-            ->map(static fn (string $xref): Individual|null => Registry::individualFactory()->make($xref, $tree))
163
+            ->map(static fn (string $xref): Individual | null => Registry::individualFactory()->make($xref, $tree))
164 164
             ->filter()
165 165
             ->filter(GedcomRecord::accessFilter());
166 166
 
@@ -179,9 +179,9 @@  discard block
 block discarded – undo
179 179
             ]);
180 180
         }
181 181
 
182
-        $individuals = array_map(static fn (string $xref): Individual|null => Registry::individualFactory()->make($xref, $tree), $xrefs);
182
+        $individuals = array_map(static fn (string $xref): Individual | null => Registry::individualFactory()->make($xref, $tree), $xrefs);
183 183
 
184
-        $individuals = array_filter($individuals, static fn (Individual|null $individual): bool => $individual instanceof Individual && $individual->canShow());
184
+        $individuals = array_filter($individuals, static fn (Individual | null $individual): bool => $individual instanceof Individual && $individual->canShow());
185 185
 
186 186
         if ($ajax) {
187 187
             $this->layout = 'layouts/ajax';
@@ -237,9 +237,9 @@  discard block
 block discarded – undo
237 237
     protected function chart(Tree $tree, array $xrefs, int $scale): ResponseInterface
238 238
     {
239 239
         /** @var Individual[] $individuals */
240
-        $individuals = array_map(static fn (string $xref): Individual|null => Registry::individualFactory()->make($xref, $tree), $xrefs);
240
+        $individuals = array_map(static fn (string $xref): Individual | null => Registry::individualFactory()->make($xref, $tree), $xrefs);
241 241
 
242
-        $individuals = array_filter($individuals, static fn (Individual|null $individual): bool => $individual instanceof Individual && $individual->canShow());
242
+        $individuals = array_filter($individuals, static fn (Individual | null $individual): bool => $individual instanceof Individual && $individual->canShow());
243 243
 
244 244
         $baseyear    = (int) date('Y');
245 245
         $topyear     = 0;
Please login to merge, or discard this patch.
app/Module/InteractiveTree/TreeView.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -93,7 +93,7 @@  discard block
 block discarded – undo
93 93
             switch ($firstLetter) {
94 94
                 case 'c':
95 95
                     $families = Collection::make(explode(',', $json_request))
96
-                        ->map(static fn (string $xref): Family|null => Registry::familyFactory()->make($xref, $tree))
96
+                        ->map(static fn (string $xref): Family | null => Registry::familyFactory()->make($xref, $tree))
97 97
                         ->filter();
98 98
 
99 99
                     $r[] = $this->drawChildren($families, 1, true);
@@ -147,7 +147,7 @@  discard block
 block discarded – undo
147 147
      *
148 148
      * @return string
149 149
      */
150
-    private function getPersonDetails(Individual $individual, Family|null $family = null): string
150
+    private function getPersonDetails(Individual $individual, Family | null $family = null): string
151 151
     {
152 152
         $chart_url = route('module', [
153 153
             'module' => 'tree',
@@ -235,7 +235,7 @@  discard block
 block discarded – undo
235 235
      *
236 236
      * @return string
237 237
      */
238
-    private function drawPerson(Individual $person, int $gen, int $state, Family|null $pfamily, string $line, bool $isRoot): string
238
+    private function drawPerson(Individual $person, int $gen, int $state, Family | null $pfamily, string $line, bool $isRoot): string
239 239
     {
240 240
         if ($gen < 0) {
241 241
             return '';
Please login to merge, or discard this patch.
app/Module/LifespansChartModule.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -248,9 +248,9 @@
 block discarded – undo
248 248
     protected function chart(Tree $tree, array $xrefs): ResponseInterface
249 249
     {
250 250
         /** @var Individual[] $individuals */
251
-        $individuals = array_map(static fn (string $xref): Individual|null => Registry::individualFactory()->make($xref, $tree), $xrefs);
251
+        $individuals = array_map(static fn (string $xref): Individual | null => Registry::individualFactory()->make($xref, $tree), $xrefs);
252 252
 
253
-        $individuals = array_filter($individuals, static fn (Individual|null $individual): bool => $individual instanceof Individual && $individual->canShow());
253
+        $individuals = array_filter($individuals, static fn (Individual | null $individual): bool => $individual instanceof Individual && $individual->canShow());
254 254
 
255 255
         // Sort the array in order of birth year
256 256
         usort($individuals, Individual::birthDateComparator());
Please login to merge, or discard this patch.
app/Media.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -75,7 +75,7 @@
 block discarded – undo
75 75
     /**
76 76
      * Get the first media file that contains an image.
77 77
      */
78
-    public function firstImageFile(): MediaFile|null
78
+    public function firstImageFile(): MediaFile | null
79 79
     {
80 80
         return $this->mediaFiles()
81 81
             ->first(static fn (MediaFile $media_file): bool => $media_file->isImage() && !$media_file->isExternal());
Please login to merge, or discard this patch.
app/Webtrees.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -240,7 +240,7 @@
 block discarded – undo
240 240
     /**
241 241
      * Run the application.
242 242
      */
243
-    public function run(string $php_sapi): int|ResponseInterface
243
+    public function run(string $php_sapi): int | ResponseInterface
244 244
     {
245 245
         if ($php_sapi === 'cli') {
246 246
             return $this->bootstrap()->cliRequest();
Please login to merge, or discard this patch.