Passed
Pull Request — main (#4945)
by
unknown
06:06
created
app/Services/SearchService.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -1070,7 +1070,7 @@
 block discarded – undo
1070 1070
      * @param Expression|string $column
1071 1071
      * @param array<string>     $search_terms
1072 1072
      */
1073
-    private function whereSearch(Builder $query, Expression|string $column, array $search_terms): void
1073
+    private function whereSearch(Builder $query, Expression | string $column, array $search_terms): void
1074 1074
     {
1075 1075
         foreach ($search_terms as $search_term) {
1076 1076
             $query->where($column, $this->iLike(), '%' . addcslashes($search_term, '\\%_') . '%');
Please login to merge, or discard this patch.
app/Module/IndividualListModule.php 2 patches
Braces   +3 added lines, -1 removed lines patch added patch discarded remove patch
@@ -290,7 +290,8 @@  discard block
 block discarded – undo
290 290
                     <li class="wt-initials-list-item d-flex">
291 291
                         <?php if ($count > 0) : ?>
292 292
                             <a href="<?= e($this->listUrl($tree, ['alpha' => $letter, 'show_marnm' => $show_marnm, 'tree' => $tree->name()])) ?>" class="wt-initial px-1<?= $letter === $alpha ? ' active' : '' ?> '" title="<?= I18N::number($count) ?>"><?= $this->displaySurnameInitial((string) $letter) ?></a>
293
-                        <?php else : ?>
293
+                        <?php else {
294
+    : ?>
294 295
                             <span class="wt-initial px-1 text-muted"><?= $this->displaySurnameInitial((string) $letter) ?></span>
295 296
 
296 297
                         <?php endif ?>
@@ -345,6 +346,7 @@  discard block
 block discarded – undo
345 346
                 switch ($alpha) {
346 347
                     case '@':
347 348
                         $filter = static fn(string $x): bool => $x === Individual::NOMEN_NESCIO;
349
+}
348 350
                         break;
349 351
                     case ',':
350 352
                         $filter = static fn(string $x): bool => $x === '';
Please login to merge, or discard this patch.
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -216,7 +216,7 @@  discard block
 block discarded – undo
216 216
         $surname_initials = $this->surnameInitials($surname_data);
217 217
 
218 218
         // We've requested a surname that doesn't currently exist.
219
-        if ($surname !== ''  && !array_key_exists($surname, $all_surns)) {
219
+        if ($surname !== '' && !array_key_exists($surname, $all_surns)) {
220 220
             $message = I18N::translate('There are no individuals with the surname “%s“', e($surname));
221 221
             FlashMessages::addMessage($message);
222 222
 
@@ -604,7 +604,7 @@  discard block
 block discarded – undo
604 604
             ->groupBy([$this->binaryColumn('n_givn')]);
605 605
 
606 606
         foreach ($query->get() as $row) {
607
-            $initial            = I18N::strtoupper(I18N::language()->initialLetter($row->n_givn));
607
+            $initial = I18N::strtoupper(I18N::language()->initialLetter($row->n_givn));
608 608
             $initials[$initial] ??= 0;
609 609
             $initials[$initial] += (int) $row->count;
610 610
         }
Please login to merge, or discard this patch.
app/Validator.php 1 patch
Spacing   +9 added lines, -9 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 $value) use ($minimum, $maximum): ?int {
128
+        $this->rules[] = static function (?int $value) use ($minimum, $maximum) : ?int {
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 $value): ?string => $value !== null && $value !== '' ? $value : null;
166
+        $this->rules[] = static fn (?string $value) : ?string => $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 $value) use ($base_url): ?string {
178
+        $this->rules[] = static function (?string $value) use ($base_url) : ?string {
179 179
             if ($value !== null) {
180 180
                 $value_info    = parse_url($value);
181 181
                 $base_url_info = parse_url($base_url);
@@ -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 $value, Closure $rule): ?array => $rule($value);
282
+        $callback = static fn (?array $value, Closure $rule) : ?array => $rule($value);
283 283
 
284 284
         return array_reduce($this->rules, $callback, $value) ?? [];
285 285
     }
@@ -300,7 +300,7 @@  discard block
 block discarded – undo
300 300
             $value = null;
301 301
         }
302 302
 
303
-        $callback = static fn (?float $value, Closure $rule): ?float => $rule($value);
303
+        $callback = static fn (?float $value, Closure $rule) : ?float => $rule($value);
304 304
 
305 305
         $value = array_reduce($this->rules, $callback, $value) ?? $default;
306 306
 
@@ -333,7 +333,7 @@  discard block
 block discarded – undo
333 333
             $value = null;
334 334
         }
335 335
 
336
-        $callback = static fn (?int $value, Closure $rule): ?int => $rule($value);
336
+        $callback = static fn (?int $value, Closure $rule) : ?int => $rule($value);
337 337
 
338 338
         $value = array_reduce($this->rules, $callback, $value) ?? $default;
339 339
 
@@ -374,9 +374,9 @@  discard block
 block discarded – undo
374 374
             $value = null;
375 375
         }
376 376
 
377
-        $callback = static fn (?string $value, Closure $rule): ?string => $rule($value);
377
+        $callback = static fn (?string $value, Closure $rule) : ?string => $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));
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
@@ -114,7 +114,7 @@
 block discarded – undo
114 114
 
115 115
             // Only update session once a minute to reduce contention on the session table.
116 116
             if ($now->subtractMinutes(1)->timestamp() > Registry::timestampFactory()->fromString($this->row->session_time)->timestamp()) {
117
-                $updates['session_time'] =  $now->toDateTimeString();
117
+                $updates['session_time'] = $now->toDateTimeString();
118 118
             }
119 119
 
120 120
             if ($updates !== []) {
Please login to merge, or discard this patch.
app/Report/HtmlRenderer.php 1 patch
Braces   +2 added lines, -1 removed lines patch added patch discarded remove patch
@@ -198,7 +198,8 @@
 block discarded – undo
198 198
         //-- footer
199 199
         echo '</div>';
200 200
         //echo '<script>document.getElementById("bodydiv").style.height="', $this->maxY, 'pt";</script>';
201
-        if ($this->Y < 200) { //heuristic guess!
201
+        if ($this->Y < 200) {
202
+//heuristic guess!
202 203
             echo '<div id="bottommargin" style="position: relative; top: auto; height: ', $this->bottom_margin - $this->footer_margin, 'pt;width:', $this->noMarginWidth, 'pt;"></div>';
203 204
             echo '<div id="footerdiv" style="position: relative; top: auto; width: ', $this->noMarginWidth, 'pt;height:auto;">';
204 205
         } else {
Please login to merge, or discard this patch.
app/Gedcom.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -346,7 +346,7 @@
 block discarded – undo
346 346
         '_MBON',
347 347
         '_NMR',
348 348
         '_SEPR',
349
-    '_SP_DEAT',  // only used internally, not exported to a gedcom file
349
+    '_SP_DEAT', // only used internally, not exported to a gedcom file
350 350
     ];
351 351
 
352 352
     public const CUSTOM_INDIVIDUAL_TAGS = [
Please login to merge, or discard this patch.
app/Report/ReportParserGenerate.php 3 patches
Upper-Lower-Casing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -1138,7 +1138,7 @@
 block discarded – undo
1138 1138
                         $value = str_replace("\n", "<br>", $value);
1139 1139
                         //$value = strip_tags(Registry::markdownFactory()->autolink($value, $this->tree), ['br']);
1140 1140
                     }
1141
-                    $value = strtr($value, [MarkdownFactory::BREAK => ' ']);
1141
+                    $value = strtr($value, [MarkdownFactory::break => ' ']);
1142 1142
                 }
1143 1143
 
1144 1144
                 if (isset($attrs['lcfirst'])) {
Please login to merge, or discard this patch.
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -1021,7 +1021,7 @@  discard block
 block discarded – undo
1021 1021
                 $this->current_element->addText(I18N::translate('Private'));
1022 1022
             } elseif ($nameselect == 'latest') {
1023 1023
                 $tmp = $record->getAllNames();
1024
-                $name  = strip_tags($tmp[count($tmp) - 1]['full']);
1024
+                $name = strip_tags($tmp[count($tmp) - 1]['full']);
1025 1025
                 $this->current_element->addText(trim($name));
1026 1026
             } elseif ($nameselect == 'combined') {
1027 1027
                 $tmp = $record->getAllNames();
@@ -1102,7 +1102,7 @@  discard block
 block discarded – undo
1102 1102
                 $value = $this->getGedcomValue($tag, $level, $this->gedrec);
1103 1103
                 switch (end($tags)) {
1104 1104
                     case 'DATE':
1105
-                        $tmp   = new Date($value);
1105
+                        $tmp = new Date($value);
1106 1106
                         $dfmt = "%j %F %Y";
1107 1107
                         if (!empty($attrs['truncate'])) {
1108 1108
                             if ($attrs['truncate'] === "d") {
@@ -1142,7 +1142,7 @@  discard block
 block discarded – undo
1142 1142
 
1143 1143
                 if (isset($attrs['lcfirst'])) {
1144 1144
                     $value = lcfirst($value);
1145
-                    $value = str_replace(["Å","Ä","Ö"], ["å","ä","ö"], $value);
1145
+                    $value = str_replace(["Å", "Ä", "Ö"], ["å", "ä", "ö"], $value);
1146 1146
                 }
1147 1147
 
1148 1148
                 if (!empty($attrs['truncate'])) {
Please login to merge, or discard this patch.
Braces   +6 added lines, -3 removed lines patch added patch discarded remove patch
@@ -1026,7 +1026,8 @@  discard block
 block discarded – undo
1026 1026
             } elseif ($nameselect == 'combined') {
1027 1027
                 $tmp = $record->getAllNames();
1028 1028
                 $name = $tmp[count($tmp) - 1]['full'];
1029
-                if ($ix1 = strpos($name, '<span class="starredname">')) {   // '«' and '»' mark text for underlining
1029
+                if ($ix1 = strpos($name, '<span class="starredname">')) {
1030
+// '«' and '»' mark text for underlining
1030 1031
                     $name = substr_replace($name, '«', $ix1, 26);
1031 1032
                     $ix1 = strpos($name, '</span>', $ix1);
1032 1033
                     $name = substr_replace($name, '»', $ix1, 7);
@@ -1501,7 +1502,8 @@  discard block
 block discarded – undo
1501 1502
         // Resort facts in chronological order, if possible
1502 1503
         $m = count($this->repeats) - 1;
1503 1504
         $prevd = 0;
1504
-        for ($i = 0; $i <= $m; $i++) { // keep undated events after previous dated event
1505
+        for ($i = 0; $i <= $m; $i++) {
1506
+// keep undated events after previous dated event
1505 1507
             if ($jdarr[$i] === 0) {
1506 1508
                 $jdarr[$i] = $prevd;
1507 1509
             } else {
@@ -1746,7 +1748,8 @@  discard block
 block discarded – undo
1746 1748
         } elseif (preg_match('/^I18N::translateContext\(\'(.+)\', *\'(.+)\'\)$/', $value, $match)) {
1747 1749
             $value = I18N::translateContext($match[1], $match[2]);
1748 1750
         }
1749
-        if (isset($attrs['lcfirst'])) { // set 1st char to lower case
1751
+        if (isset($attrs['lcfirst'])) {
1752
+// set 1st char to lower case
1750 1753
             $value = lcfirst($value);
1751 1754
         }
1752 1755
 
Please login to merge, or discard this patch.
app/Report/ReportHtmlTextbox.php 2 patches
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -69,7 +69,7 @@  discard block
 block discarded – undo
69 69
                         $lastelement   = $element;
70 70
                     }
71 71
                 } elseif ($element instanceof ReportHtmlImage) {
72
-                    $lastelement   = $element;
72
+                    $lastelement = $element;
73 73
                 } elseif ($element instanceof ReportHtmlFootnote) {
74 74
                     // Check if the Footnote has been set with it’s link number
75 75
                     $renderer->checkFootnote($element);
@@ -141,7 +141,7 @@  discard block
 block discarded – undo
141 141
             $this->top += 222000;
142 142
         }
143 143
         if ($this->top < -10000) { // <= -100000: both pdf and html; -100000 -- -90000: only html
144
-            $this->top += 90000;  //= ReportBaseElement::CURRENT_POSITION;
144
+            $this->top += 90000; //= ReportBaseElement::CURRENT_POSITION;
145 145
             if ($this->top < -9000) {
146 146
                 $this->top += 10000;
147 147
             }
Please login to merge, or discard this patch.
Braces   +4 added lines, -2 removed lines patch added patch discarded remove patch
@@ -137,10 +137,12 @@
 block discarded – undo
137 137
         // If current position (top)
138 138
         $align_Y = false;
139 139
         $topstr = "";
140
-        if ($this->top < -110000) { // pos='abs'
140
+        if ($this->top < -110000) {
141
+// pos='abs'
141 142
             $this->top += 222000;
142 143
         }
143
-        if ($this->top < -10000) { // <= -100000: both pdf and html; -100000 -- -90000: only html
144
+        if ($this->top < -10000) {
145
+// <= -100000: both pdf and html; -100000 -- -90000: only html
144 146
             $this->top += 90000;  //= ReportBaseElement::CURRENT_POSITION;
145 147
             if ($this->top < -9000) {
146 148
                 $this->top += 10000;
Please login to merge, or discard this patch.
app/Report/ReportPdfTextBox.php 2 patches
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -356,7 +356,7 @@
 block discarded – undo
356 356
         $curr_P = $renderer->tcpdf->getPage();
357 357
         // New line and some clean up
358 358
         if (!$this->newline) {
359
-            $renderer->tcpdf->setXY($cX + $cW, $cY);   // $curr_Y);
359
+            $renderer->tcpdf->setXY($cX + $cW, $cY); // $curr_Y);
360 360
             $renderer->lastCellHeight = $cH;
361 361
         } else {
362 362
             // addMarginX() also updates X
Please login to merge, or discard this patch.
Braces   +4 added lines, -2 removed lines patch added patch discarded remove patch
@@ -139,10 +139,12 @@
 block discarded – undo
139 139
         // If current position (top)
140 140
         $align_Y = false;
141 141
         $curr_P = $renderer->tcpdf->getPage();
142
-        if ($this->top < -95000) { // 90000: only html; 100000: both pdf and html
142
+        if ($this->top < -95000) {
143
+// 90000: only html; 100000: both pdf and html
143 144
             $align_Y = true;
144 145
         }
145
-        if ($this->top < -200000) {   // pos="abs"
146
+        if ($this->top < -200000) {
147
+// pos="abs"
146 148
             $this->top += 222000;
147 149
         } else {
148 150
             $this->top = ReportBaseElement::CURRENT_POSITION;
Please login to merge, or discard this patch.