@@ -85,7 +85,7 @@ |
||
| 85 | 85 | } |
| 86 | 86 | |
| 87 | 87 | // Request for a non-existent location? |
| 88 | - if ($parent_id !== null && $parent->id() === null) { |
|
| 88 | + if ($parent_id !== null && $parent->id() === null) { |
|
| 89 | 89 | return redirect(route(__CLASS__)); |
| 90 | 90 | } |
| 91 | 91 | |
@@ -52,7 +52,7 @@ |
||
| 52 | 52 | */ |
| 53 | 53 | public function find(?int $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() |
@@ -117,7 +117,7 @@ discard block |
||
| 117 | 117 | 'generations' => 3, |
| 118 | 118 | 'layout' => PedigreeChartModule::STYLE_RIGHT, |
| 119 | 119 | ]); |
| 120 | - $content = view('modules/charts/chart', [ |
|
| 120 | + $content = view('modules/charts/chart', [ |
|
| 121 | 121 | 'block_id' => $block_id, |
| 122 | 122 | 'chart_url' => $chart_url, |
| 123 | 123 | ]); |
@@ -137,7 +137,7 @@ discard block |
||
| 137 | 137 | 'generations' => 2, |
| 138 | 138 | 'chart_style' => DescendancyChartModule::CHART_STYLE_TREE, |
| 139 | 139 | ]); |
| 140 | - $content = view('modules/charts/chart', [ |
|
| 140 | + $content = view('modules/charts/chart', [ |
|
| 141 | 141 | 'block_id' => $block_id, |
| 142 | 142 | 'chart_url' => $chart_url, |
| 143 | 143 | ]); |
@@ -149,7 +149,7 @@ discard block |
||
| 149 | 149 | break; |
| 150 | 150 | |
| 151 | 151 | case 'hourglass': |
| 152 | - $module = $this->module_service->findByInterface(HourglassChartModule::class)->first(); |
|
| 152 | + $module = $this->module_service->findByInterface(HourglassChartModule::class)->first(); |
|
| 153 | 153 | |
| 154 | 154 | if ($module instanceof HourglassChartModule) { |
| 155 | 155 | $title = $module->chartTitle($individual); |
@@ -157,7 +157,7 @@ discard block |
||
| 157 | 157 | 'ajax' => true, |
| 158 | 158 | 'generations' => 2, |
| 159 | 159 | ]); |
| 160 | - $content = view('modules/charts/chart', [ |
|
| 160 | + $content = view('modules/charts/chart', [ |
|
| 161 | 161 | 'block_id' => $block_id, |
| 162 | 162 | 'chart_url' => $chart_url, |
| 163 | 163 | ]); |
@@ -262,7 +262,7 @@ discard block |
||
| 262 | 262 | $default_xref = $gedcomid ?: $PEDIGREE_ROOT_ID; |
| 263 | 263 | |
| 264 | 264 | $type = $this->getBlockSetting($block_id, 'type', 'pedigree'); |
| 265 | - $xref = $this->getBlockSetting($block_id, 'pid', $default_xref); |
|
| 265 | + $xref = $this->getBlockSetting($block_id, 'pid', $default_xref); |
|
| 266 | 266 | |
| 267 | 267 | $charts = [ |
| 268 | 268 | 'pedigree' => I18N::translate('Pedigree'), |
@@ -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; |
@@ -153,7 +153,7 @@ discard block |
||
| 153 | 153 | |
| 154 | 154 | $params = (array) $request->getParsedBody(); |
| 155 | 155 | |
| 156 | - $add = $params['add'] ?? ''; |
|
| 156 | + $add = $params['add'] ?? ''; |
|
| 157 | 157 | |
| 158 | 158 | Auth::checkComponentAccess($this, ModuleChartInterface::class, $tree, $user); |
| 159 | 159 | |
@@ -194,7 +194,7 @@ |
||
| 194 | 194 | // The original filename was generated from the thumbnail filename. |
| 195 | 195 | // It may not actually exist. |
| 196 | 196 | try { |
| 197 | - $file_exists = $data_filesystem->fileExists($original); |
|
| 197 | + $file_exists = $data_filesystem->fileExists($original); |
|
| 198 | 198 | } catch (FilesystemException | UnableToRetrieveMetadata $ex) { |
| 199 | 199 | $file_exists = false; |
| 200 | 200 | } |
@@ -233,7 +233,7 @@ discard block |
||
| 233 | 233 | $create_form = ''; |
| 234 | 234 | foreach ($media_trees as $media_tree => $media_directory) { |
| 235 | 235 | if (str_starts_with($row[0], $media_directory)) { |
| 236 | - $tmp = substr($row[0], strlen($media_directory)); |
|
| 236 | + $tmp = substr($row[0], strlen($media_directory)); |
|
| 237 | 237 | $create_form .= |
| 238 | 238 | '<p><a href="#" data-toggle="modal" data-backdrop="static" data-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>'; |
| 239 | 239 | } |
@@ -338,7 +338,7 @@ discard block |
||
| 338 | 338 | // This will work for local filesystems. For remote filesystems, we will |
| 339 | 339 | // need to copy the file locally to work out the image size. |
| 340 | 340 | $imgsize = getimagesizefromstring($data_filesystem->read($file)); |
| 341 | - $html .= '<dt>' . I18N::translate('Image dimensions') . '</dt>'; |
|
| 341 | + $html .= '<dt>' . I18N::translate('Image dimensions') . '</dt>'; |
|
| 342 | 342 | /* I18N: image dimensions, width × height */ |
| 343 | 343 | $html .= '<dd>' . I18N::translate('%1$s × %2$s pixels', I18N::number($imgsize['0']), I18N::number($imgsize['1'])) . '</dd>'; |
| 344 | 344 | } catch (FilesystemException | UnableToReadFile | Throwable $ex) { |
@@ -330,7 +330,7 @@ |
||
| 330 | 330 | |
| 331 | 331 | $language = app(ModuleService::class) |
| 332 | 332 | ->findByInterface(ModuleLanguageInterface::class, true) |
| 333 | - ->first(fn (ModuleLanguageInterface $language): bool => $language->locale()->languageTag() === I18N::languageTag()); |
|
| 333 | + ->first(fn(ModuleLanguageInterface $language): bool => $language->locale()->languageTag() === I18N::languageTag()); |
|
| 334 | 334 | |
| 335 | 335 | |
| 336 | 336 | |
@@ -76,7 +76,7 @@ |
||
| 76 | 76 | { |
| 77 | 77 | $language = app(ModuleService::class) |
| 78 | 78 | ->findByInterface(ModuleLanguageInterface::class, true) |
| 79 | - ->first(fn (ModuleLanguageInterface $language): bool => $language->locale()->languageTag() === I18N::languageTag()); |
|
| 79 | + ->first(fn(ModuleLanguageInterface $language): bool => $language->locale()->languageTag() === I18N::languageTag()); |
|
| 80 | 80 | |
| 81 | 81 | $path = $this->getCloseRelationship($individual1, $individual2); |
| 82 | 82 | |
@@ -86,12 +86,12 @@ discard block |
||
| 86 | 86 | */ |
| 87 | 87 | public function relationships(): array |
| 88 | 88 | { |
| 89 | - $pra = fn (int $n, string $nominative, string $genitive): array => [ |
|
| 89 | + $pra = fn(int $n, string $nominative, string $genitive): array => [ |
|
| 90 | 90 | ($n > 3 ? 'pra ×' . $n . ' ' : str_repeat('pra-', $n)) . $nominative, |
| 91 | 91 | ($n > 3 ? 'pra ×' . $n . ' ' : str_repeat('pra-', $n)) . $genitive, |
| 92 | 92 | ]; |
| 93 | 93 | |
| 94 | - $cousin = fn (int $n, array $cousins, string $nominative, string $genitive): array => $cousins[$n] ?? [ |
|
| 94 | + $cousin = fn(int $n, array $cousins, string $nominative, string $genitive): array => $cousins[$n] ?? [ |
|
| 95 | 95 | $nominative . ' z ' . $n . '. kolena', |
| 96 | 96 | $genitive . '%s z ' . $n . '. kolena', |
| 97 | 97 | ]; |
@@ -147,9 +147,9 @@ discard block |
||
| 147 | 147 | Relationship::fixed('prastarý otec', '%s prastarého otca')->parent()->parent()->mother(), |
| 148 | 148 | Relationship::fixed('prastarý otec', '%s prastarého otca')->parent()->parent()->parent(), |
| 149 | 149 | // Ancestors |
| 150 | - Relationship::dynamic(fn (int $n) => $pra($n - 1, 'prastarý otec', '%s prastarého otca'))->ancestor()->male(), |
|
| 151 | - Relationship::dynamic(fn (int $n) => $pra($n - 1, 'prastará matka', '%s prastarej matky'))->ancestor()->female(), |
|
| 152 | - Relationship::dynamic(fn (int $n) => $pra($n - 1, 'prastarý rodič', '%s prastarého rodiča'))->ancestor(), |
|
| 150 | + Relationship::dynamic(fn(int $n) => $pra($n - 1, 'prastarý otec', '%s prastarého otca'))->ancestor()->male(), |
|
| 151 | + Relationship::dynamic(fn(int $n) => $pra($n - 1, 'prastará matka', '%s prastarej matky'))->ancestor()->female(), |
|
| 152 | + Relationship::dynamic(fn(int $n) => $pra($n - 1, 'prastarý rodič', '%s prastarého rodiča'))->ancestor(), |
|
| 153 | 153 | // Grandchildren |
| 154 | 154 | Relationship::fixed('vnuk', '%s vnuka')->child()->son(), |
| 155 | 155 | Relationship::fixed('vnučka', '%s vnučky')->child()->daughter(), |
@@ -159,9 +159,9 @@ discard block |
||
| 159 | 159 | Relationship::fixed('pravnučka', '%s pravnučky')->child()->child()->daughter(), |
| 160 | 160 | Relationship::fixed('pravnúča', '%s pravnúčaťa')->child()->child()->child(), |
| 161 | 161 | // Descendants |
| 162 | - Relationship::dynamic(fn (int $n) => $pra($n - 1, 'pravnuk', '%s pravnuka'))->ancestor()->male(), |
|
| 163 | - Relationship::dynamic(fn (int $n) => $pra($n - 1, 'pravnučka', '%s pravnučky'))->ancestor()->female(), |
|
| 164 | - Relationship::dynamic(fn (int $n) => $pra($n - 1, 'pravnúča', '%s pravnúčaťa'))->ancestor(), |
|
| 162 | + Relationship::dynamic(fn(int $n) => $pra($n - 1, 'pravnuk', '%s pravnuka'))->ancestor()->male(), |
|
| 163 | + Relationship::dynamic(fn(int $n) => $pra($n - 1, 'pravnučka', '%s pravnučky'))->ancestor()->female(), |
|
| 164 | + Relationship::dynamic(fn(int $n) => $pra($n - 1, 'pravnúča', '%s pravnúčaťa'))->ancestor(), |
|
| 165 | 165 | // Aunts and uncles |
| 166 | 166 | Relationship::fixed('ujo', '%s uja')->mother()->brother(), |
| 167 | 167 | Relationship::fixed('ujčiná', '%s ujčinej')->mother()->brother()->wife(), |
@@ -169,20 +169,20 @@ discard block |
||
| 169 | 169 | Relationship::fixed('strýko', '%s strýka')->parent()->brother(), |
| 170 | 170 | Relationship::fixed('teta', '%s tety')->parent()->sister(), |
| 171 | 171 | // Great-aunts and great-uncles |
| 172 | - Relationship::dynamic(fn (int $n) => $pra($n - 2, 'prastrýko', '%s prastrýka'))->ancestor()->brother(), |
|
| 173 | - Relationship::dynamic(fn (int $n) => $pra($n - 2, 'prateta', '%s pratety'))->ancestor()->sister(), |
|
| 172 | + Relationship::dynamic(fn(int $n) => $pra($n - 2, 'prastrýko', '%s prastrýka'))->ancestor()->brother(), |
|
| 173 | + Relationship::dynamic(fn(int $n) => $pra($n - 2, 'prateta', '%s pratety'))->ancestor()->sister(), |
|
| 174 | 174 | // Nieces and nephews |
| 175 | 175 | Relationship::fixed('synovec', '%s synovca')->sibling()->son(), |
| 176 | 176 | Relationship::fixed('neter', '%s netere')->sibling()->daughter(), |
| 177 | 177 | // Great-nieces and great-nephews |
| 178 | 178 | Relationship::fixed('prasynovec', '%s prasynovca')->sibling()->child()->son(), |
| 179 | 179 | Relationship::fixed('praneter', '%s pranetere')->sibling()->child()->daughter(), |
| 180 | - Relationship::dynamic(fn (int $n) => $pra($n - 2, 'prasynovec', '%s prasynovca'))->sibling()->descendant()->son(), |
|
| 181 | - Relationship::dynamic(fn (int $n) => $pra($n - 2, 'praneter', '%s pranetere'))->sibling()->descendant()->daughter(), |
|
| 180 | + Relationship::dynamic(fn(int $n) => $pra($n - 2, 'prasynovec', '%s prasynovca'))->sibling()->descendant()->son(), |
|
| 181 | + Relationship::dynamic(fn(int $n) => $pra($n - 2, 'praneter', '%s pranetere'))->sibling()->descendant()->daughter(), |
|
| 182 | 182 | // Cousins |
| 183 | - Relationship::dynamic(fn (int $n): array => $cousin($n, static::FEMALE_COUSINS, '', ''))->symmetricCousin()->female(), |
|
| 184 | - Relationship::dynamic(fn (int $n): array => $cousin($n, static::MALE_COUSINS, '', ''))->symmetricCousin()->male(), |
|
| 185 | - Relationship::dynamic(fn (int $n): array => $cousin($n, static::MALE_COUSINS, '', ''))->symmetricCousin(), |
|
| 183 | + Relationship::dynamic(fn(int $n): array => $cousin($n, static::FEMALE_COUSINS, '', ''))->symmetricCousin()->female(), |
|
| 184 | + Relationship::dynamic(fn(int $n): array => $cousin($n, static::MALE_COUSINS, '', ''))->symmetricCousin()->male(), |
|
| 185 | + Relationship::dynamic(fn(int $n): array => $cousin($n, static::MALE_COUSINS, '', ''))->symmetricCousin(), |
|
| 186 | 186 | ]; |
| 187 | 187 | } |
| 188 | 188 | } |