@@ -87,7 +87,7 @@ discard block |
||
| 87 | 87 | */ |
| 88 | 88 | public function __construct(GedcomService $gedcom_service) |
| 89 | 89 | { |
| 90 | - $this->gedcom_service = $gedcom_service; |
|
| 90 | + $this->gedcom_service = $gedcom_service; |
|
| 91 | 91 | } |
| 92 | 92 | |
| 93 | 93 | /** |
@@ -161,13 +161,13 @@ discard block |
||
| 161 | 161 | |
| 162 | 162 | if ($place_id === 0) { |
| 163 | 163 | $breadcrumbs[] = I18N::translate('Add'); |
| 164 | - $title .= ' — ' . I18N::translate('Add'); |
|
| 164 | + $title .= ' — ' . I18N::translate('Add'); |
|
| 165 | 165 | $latitude = 0.0; |
| 166 | 166 | $longitude = 0.0; |
| 167 | 167 | $map_bounds = $parent->boundingRectangle(); |
| 168 | 168 | } else { |
| 169 | 169 | $breadcrumbs[] = I18N::translate('Edit'); |
| 170 | - $title .= ' — ' . I18N::translate('Edit'); |
|
| 170 | + $title .= ' — ' . I18N::translate('Edit'); |
|
| 171 | 171 | $latitude = $location->latitude(); |
| 172 | 172 | $longitude = $location->longitude(); |
| 173 | 173 | $map_bounds = $location->boundingRectangle(); |
@@ -46,7 +46,7 @@ discard block |
||
| 46 | 46 | { |
| 47 | 47 | use ModuleChartTrait; |
| 48 | 48 | |
| 49 | - protected const ROUTE_URL = '/tree/{tree}/timeline-{scale}'; |
|
| 49 | + protected const ROUTE_URL = '/tree/{tree}/timeline-{scale}'; |
|
| 50 | 50 | |
| 51 | 51 | // Defaults |
| 52 | 52 | protected const DEFAULT_SCALE = 10; |
@@ -67,7 +67,7 @@ discard block |
||
| 67 | 67 | '_TODO', |
| 68 | 68 | 'CHAN', |
| 69 | 69 | ]; |
| 70 | - protected const BHEIGHT = 30; |
|
| 70 | + protected const BHEIGHT = 30; |
|
| 71 | 71 | |
| 72 | 72 | // Box height |
| 73 | 73 | |
@@ -152,7 +152,7 @@ discard block |
||
| 152 | 152 | |
| 153 | 153 | $params = (array) $request->getParsedBody(); |
| 154 | 154 | |
| 155 | - $add = $params['add'] ?? ''; |
|
| 155 | + $add = $params['add'] ?? ''; |
|
| 156 | 156 | |
| 157 | 157 | Auth::checkComponentAccess($this, ModuleChartInterface::class, $tree, $user); |
| 158 | 158 | |
@@ -272,7 +272,7 @@ discard block |
||
| 272 | 272 | $create_form = ''; |
| 273 | 273 | foreach ($media_trees as $media_tree => $media_directory) { |
| 274 | 274 | if (str_starts_with($row[0], $media_directory)) { |
| 275 | - $tmp = substr($row[0], strlen($media_directory)); |
|
| 275 | + $tmp = substr($row[0], strlen($media_directory)); |
|
| 276 | 276 | $create_form .= |
| 277 | 277 | '<p><a href="#" data-toggle="modal" data-backdrop="static" data-target="#modal-create-media-from-file" data-file="' . e($tmp) . '" data-url="' . e(route('create-media-from-file', ['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>'; |
| 278 | 278 | } |
@@ -366,8 +366,8 @@ discard block |
||
| 366 | 366 | try { |
| 367 | 367 | // This will work for local filesystems. For remote filesystems, we will |
| 368 | 368 | // need to copy the file locally to work out the image size. |
| 369 | - $imgsize = getimagesize(Webtrees::DATA_DIR . $file); |
|
| 370 | - $html .= '<dt>' . I18N::translate('Image dimensions') . '</dt>'; |
|
| 369 | + $imgsize = getimagesize(Webtrees::DATA_DIR . $file); |
|
| 370 | + $html .= '<dt>' . I18N::translate('Image dimensions') . '</dt>'; |
|
| 371 | 371 | /* I18N: image dimensions, width × height */ |
| 372 | 372 | $html .= '<dd>' . I18N::translate('%1$s × %2$s pixels', I18N::number($imgsize['0']), I18N::number($imgsize['1'])) . '</dd>'; |
| 373 | 373 | } catch (Throwable $ex) { |
@@ -52,7 +52,7 @@ |
||
| 52 | 52 | */ |
| 53 | 53 | public function find($user_id): ?User |
| 54 | 54 | { |
| 55 | - return Registry::cache()->array()->remember('user-' . $user_id, static function () use ($user_id): ?User { |
|
| 55 | + return Registry::cache()->array()->remember('user-' . $user_id, static function () use ($user_id) : ?User { |
|
| 56 | 56 | return DB::table('user') |
| 57 | 57 | ->where('user_id', '=', $user_id) |
| 58 | 58 | ->get() |
@@ -112,7 +112,7 @@ |
||
| 112 | 112 | '<div class="gedcom-data" dir="ltr">' . |
| 113 | 113 | preg_replace_callback( |
| 114 | 114 | '/@(' . Gedcom::REGEX_XREF . ')@/', |
| 115 | - static function (array $match) use ($tree): string { |
|
| 115 | + static function (array $match) use ($tree) : string { |
|
| 116 | 116 | $record = Registry::gedcomRecordFactory()->make($match[1], $tree); |
| 117 | 117 | |
| 118 | 118 | return $record ? '<a href="' . e($record->url()) . '">' . $match[0] . '</a>' : $match[0]; |
@@ -172,7 +172,7 @@ discard block |
||
| 172 | 172 | if ($note->canShow()) { |
| 173 | 173 | $noterec = $note->gedcom(); |
| 174 | 174 | $nt = preg_match("/0 @$nmatch[1]@ NOTE (.*)/", $noterec, $n1match); |
| 175 | - $data .= self::printNoteRecord($tree, $nt > 0 ? $n1match[1] : '', 1, $noterec); |
|
| 175 | + $data .= self::printNoteRecord($tree, $nt > 0 ? $n1match[1] : '', 1, $noterec); |
|
| 176 | 176 | } |
| 177 | 177 | } else { |
| 178 | 178 | $data = '<div class="fact_NOTE"><span class="label">' . I18N::translate('Note') . '</span>: <span class="field error">' . $nmatch[1] . '</span></div>'; |
@@ -272,7 +272,7 @@ discard block |
||
| 272 | 272 | } |
| 273 | 273 | }, |
| 274 | 274 | $age_string |
| 275 | - ) ; |
|
| 275 | + ); |
|
| 276 | 276 | } |
| 277 | 277 | } |
| 278 | 278 | |
@@ -336,7 +336,7 @@ discard block |
||
| 336 | 336 | $ageText = ''; |
| 337 | 337 | if ($fact === 'DEAT' || Date::compare($date, $death_date) <= 0 || !$record->isDead()) { |
| 338 | 338 | // Before death, print age |
| 339 | - $age = (new Age($birth_date, $date))->ageAtEvent(false,$record->sex()); |
|
| 339 | + $age = (new Age($birth_date, $date))->ageAtEvent(false, $record->sex()); |
|
| 340 | 340 | // Only show calculated age if it differs from recorded age |
| 341 | 341 | if ($age !== '') { |
| 342 | 342 | if ($fact_age !== '' && $fact_age !== $age) { |
@@ -406,20 +406,20 @@ discard block |
||
| 406 | 406 | if (preg_match_all('/\n3 (?:_HEB|ROMN) (.+)/', $placerec, $matches)) { |
| 407 | 407 | foreach ($matches[1] as $match) { |
| 408 | 408 | $wt_place = new Place($match, $tree); |
| 409 | - $html .= ' - ' . $wt_place->fullName(); |
|
| 409 | + $html .= ' - ' . $wt_place->fullName(); |
|
| 410 | 410 | } |
| 411 | 411 | } |
| 412 | 412 | $map_lati = ''; |
| 413 | 413 | $cts = preg_match('/\d LATI (.*)/', $placerec, $match); |
| 414 | 414 | if ($cts > 0) { |
| 415 | 415 | $map_lati = $match[1]; |
| 416 | - $html .= '<br><span class="label">' . I18N::translate('Latitude') . ': </span>' . $map_lati; |
|
| 416 | + $html .= '<br><span class="label">' . I18N::translate('Latitude') . ': </span>' . $map_lati; |
|
| 417 | 417 | } |
| 418 | 418 | $map_long = ''; |
| 419 | 419 | $cts = preg_match('/\d LONG (.*)/', $placerec, $match); |
| 420 | 420 | if ($cts > 0) { |
| 421 | 421 | $map_long = $match[1]; |
| 422 | - $html .= ' <span class="label">' . I18N::translate('Longitude') . ': </span>' . $map_long; |
|
| 422 | + $html .= ' <span class="label">' . I18N::translate('Longitude') . ': </span>' . $map_long; |
|
| 423 | 423 | } |
| 424 | 424 | if ($map_lati && $map_long) { |
| 425 | 425 | $map_lati = trim(strtr($map_lati, 'NSEW,�', ' - -. ')); // S5,6789 ==> -5.6789 |
@@ -111,11 +111,11 @@ |
||
| 111 | 111 | |
| 112 | 112 | if ($individual->isDead()) { |
| 113 | 113 | // If dead, show age at death |
| 114 | - $age = (new Age($bdate, $ddate))->ageAtEvent(false,$individual->sex()); |
|
| 114 | + $age = (new Age($bdate, $ddate))->ageAtEvent(false, $individual->sex()); |
|
| 115 | 115 | } else { |
| 116 | 116 | // If living, show age today |
| 117 | 117 | $today = strtoupper(date('d M Y')); |
| 118 | - $age = (new Age($bdate, new Date($today)))->ageAtEvent(true,$individual->sex()); |
|
| 118 | + $age = (new Age($bdate, new Date($today)))->ageAtEvent(true, $individual->sex()); |
|
| 119 | 119 | } |
| 120 | 120 | |
| 121 | 121 | // What images are linked to this individual |
@@ -531,14 +531,14 @@ discard block |
||
| 531 | 531 | } |
| 532 | 532 | |
| 533 | 533 | // Compute age of associated Person at the event (Person BIRT is mandatory ) |
| 534 | - $ageOfAssociated =""; |
|
| 534 | + $ageOfAssociated = ""; |
|
| 535 | 535 | if (preg_match('/\n2 DATE (.+)/', $event->gedcom(), $match1)) { |
| 536 | 536 | if (preg_match('/\n1 BIRT/', $person->gedcom(), $match)) { |
| 537 | 537 | preg_match('/\n2 DATE (.+)/', $person->gedcom(), $match2); |
| 538 | 538 | $isLiving = !preg_match('/\n1 DEAT/', $person->gedcom(), $match3); |
| 539 | 539 | $dateEvent = new Date($match1[1]); |
| 540 | 540 | $dateAssoP = new Date($match2[1]); |
| 541 | - $ageOfAssociated = (new Age($dateAssoP, $dateEvent))->ageAtEvent($isLiving,$person->sex()); |
|
| 541 | + $ageOfAssociated = (new Age($dateAssoP, $dateEvent))->ageAtEvent($isLiving, $person->sex()); |
|
| 542 | 542 | } |
| 543 | 543 | } |
| 544 | 544 | $values = ['<a href="' . e($person->url()) . '">' . $person->fullName() . '<i> ' . $ageOfAssociated . '</i>' . '</a>']; |
@@ -602,7 +602,7 @@ discard block |
||
| 602 | 602 | for ($j = 0; $j < $ct; $j++) { |
| 603 | 603 | if (!str_contains($match[$j][1], '@')) { |
| 604 | 604 | $source = e($match[$j][1] . preg_replace('/\n\d CONT ?/', "\n", $match[$j][2])); |
| 605 | - $data .= '<div class="fact_SOUR"><span class="label">' . I18N::translate('Source') . ':</span> <span class="field" dir="auto">' . Filter::formatText($source, $tree) . '</span></div>'; |
|
| 605 | + $data .= '<div class="fact_SOUR"><span class="label">' . I18N::translate('Source') . ':</span> <span class="field" dir="auto">' . Filter::formatText($source, $tree) . '</span></div>'; |
|
| 606 | 606 | } |
| 607 | 607 | } |
| 608 | 608 | // Find source for each fact |
@@ -620,7 +620,7 @@ discard block |
||
| 620 | 620 | } |
| 621 | 621 | $srec = substr($factrec, $spos1, $spos2 - $spos1); |
| 622 | 622 | $lt = preg_match_all("/$nlevel \w+/", $srec, $matches); |
| 623 | - $data .= '<div class="fact_SOUR">'; |
|
| 623 | + $data .= '<div class="fact_SOUR">'; |
|
| 624 | 624 | $id = 'collapse-' . Uuid::uuid4()->toString(); |
| 625 | 625 | $expanded = (bool) $tree->getPreference('EXPAND_SOURCES'); |
| 626 | 626 | if ($lt > 0) { |