@@ -202,7 +202,7 @@ |
||
| 202 | 202 | ->where('id', '=', $location->id) |
| 203 | 203 | ->delete(); |
| 204 | 204 | } else { |
| 205 | - $place_ids = $places->map(static fn (object $place): int => (int) $place->p_id)->all(); |
|
| 205 | + $place_ids = $places->map(static fn(object $place): int => (int) $place->p_id)->all(); |
|
| 206 | 206 | $this->deleteUnusedLocations((int) $location->id, $place_ids); |
| 207 | 207 | } |
| 208 | 208 | } |
@@ -110,24 +110,24 @@ discard block |
||
| 110 | 110 | public function relationships(): array |
| 111 | 111 | { |
| 112 | 112 | // Construct the genitive form in French |
| 113 | - $genitive = fn (string $s, string $genitive_link): array => [$s, '%s ' . $genitive_link . $s]; |
|
| 113 | + $genitive = fn(string $s, string $genitive_link): array => [$s, '%s ' . $genitive_link . $s]; |
|
| 114 | 114 | |
| 115 | 115 | // Functions to coumpound the name that can be indefinitely repeated |
| 116 | - $degree = fn (int $n, string $suffix, string $genitive_link): array => |
|
| 116 | + $degree = fn(int $n, string $suffix, string $genitive_link): array => |
|
| 117 | 117 | $genitive("$suffix au {$n}<sup>e</sup> degré", $genitive_link); |
| 118 | 118 | |
| 119 | - $great = fn (int $n, string $suffix, string $genitive_link): array => |
|
| 119 | + $great = fn(int $n, string $suffix, string $genitive_link): array => |
|
| 120 | 120 | $n <= 1 ? $genitive('arrière-' . $suffix, 'de l’') : $degree($n + 1, $suffix, $genitive_link); |
| 121 | 121 | |
| 122 | - $firstCompound = fn (int $n, string $suffix, string $genitive_link): array => |
|
| 122 | + $firstCompound = fn(int $n, string $suffix, string $genitive_link): array => |
|
| 123 | 123 | $n <= 1 ? $genitive($suffix, $genitive_link) : $great($n - 1, $suffix, $genitive_link); |
| 124 | 124 | |
| 125 | 125 | $compound = |
| 126 | - fn (int $n, string $first_level, string $suffix, string $genitive_none, string $genitive_first): array => |
|
| 126 | + fn(int $n, string $first_level, string $suffix, string $genitive_none, string $genitive_first): array => |
|
| 127 | 127 | $n <= 1 ? $genitive($suffix, $genitive_none) : $firstCompound($n - 1, $first_level . $suffix, $genitive_first); |
| 128 | 128 | |
| 129 | 129 | // Functions to translate cousins' degree of relationship |
| 130 | - $symmetricCousin = fn (int $n, string $sex): array => self::SYMMETRIC_COUSINS[$n][$sex] ?? $genitive( |
|
| 130 | + $symmetricCousin = fn(int $n, string $sex): array => self::SYMMETRIC_COUSINS[$n][$sex] ?? $genitive( |
|
| 131 | 131 | $sex === 'F' ? 'cousine au ' . $n . '<sup>e</sup> degré' : 'cousin au ' . $n . '<sup>e</sup> degré', |
| 132 | 132 | $sex === 'F' ? 'de la ' : 'du ' |
| 133 | 133 | ); |
@@ -144,8 +144,7 @@ discard block |
||
| 144 | 144 | } |
| 145 | 145 | return $genitive( |
| 146 | 146 | $sex === 'F' ? |
| 147 | - 'cousine du ' . $down . '<sup>e</sup> au ' . $up . '<sup>e</sup> degré' : |
|
| 148 | - 'cousin du ' . $down . '<sup>e</sup> au ' . $up . '<sup>e</sup> degré', |
|
| 147 | + 'cousine du ' . $down . '<sup>e</sup> au ' . $up . '<sup>e</sup> degré' : 'cousin du ' . $down . '<sup>e</sup> au ' . $up . '<sup>e</sup> degré', |
|
| 149 | 148 | $sex === 'F' ? 'de la ' : 'du ' |
| 150 | 149 | ); |
| 151 | 150 | }; |
@@ -247,31 +246,31 @@ discard block |
||
| 247 | 246 | Relationship::fixed('trisaïeul paternel', '%s du trisaïeul paternel')->father()->parent()->parent()->father(), |
| 248 | 247 | Relationship::fixed('trisaïeule', '%s de la trisaïeule')->parent()->parent()->parent()->mother(), |
| 249 | 248 | Relationship::fixed('trisaïeul', '%s du trisaïeul')->parent()->parent()->parent()->father(), |
| 250 | - Relationship::dynamic(fn (int $n) => $firstCompound($n, 'grand-mère maternelle', 'de la '))->mother()->ancestor()->female(), |
|
| 251 | - Relationship::dynamic(fn (int $n) => $firstCompound($n, 'grand-père maternel', 'du '))->mother()->ancestor()->male(), |
|
| 252 | - Relationship::dynamic(fn (int $n) => $firstCompound($n, 'grand-parent maternel', 'du '))->mother()->ancestor(), |
|
| 253 | - Relationship::dynamic(fn (int $n) => $firstCompound($n, 'grand-mère paternelle', 'de la '))->father()->ancestor()->female(), |
|
| 254 | - Relationship::dynamic(fn (int $n) => $firstCompound($n, 'grand-père paternel', 'du '))->father()->ancestor()->male(), |
|
| 255 | - Relationship::dynamic(fn (int $n) => $firstCompound($n, 'grand-parent paternel', 'du '))->father()->ancestor(), |
|
| 256 | - Relationship::dynamic(fn (int $n) => $firstCompound($n, 'grand-mère', 'de la '))->parent()->ancestor()->female(), |
|
| 257 | - Relationship::dynamic(fn (int $n) => $firstCompound($n, 'grand-père', 'du '))->parent()->ancestor()->male(), |
|
| 258 | - Relationship::dynamic(fn (int $n) => $firstCompound($n, 'grand-parent', 'du '))->parent()->ancestor(), |
|
| 249 | + Relationship::dynamic(fn(int $n) => $firstCompound($n, 'grand-mère maternelle', 'de la '))->mother()->ancestor()->female(), |
|
| 250 | + Relationship::dynamic(fn(int $n) => $firstCompound($n, 'grand-père maternel', 'du '))->mother()->ancestor()->male(), |
|
| 251 | + Relationship::dynamic(fn(int $n) => $firstCompound($n, 'grand-parent maternel', 'du '))->mother()->ancestor(), |
|
| 252 | + Relationship::dynamic(fn(int $n) => $firstCompound($n, 'grand-mère paternelle', 'de la '))->father()->ancestor()->female(), |
|
| 253 | + Relationship::dynamic(fn(int $n) => $firstCompound($n, 'grand-père paternel', 'du '))->father()->ancestor()->male(), |
|
| 254 | + Relationship::dynamic(fn(int $n) => $firstCompound($n, 'grand-parent paternel', 'du '))->father()->ancestor(), |
|
| 255 | + Relationship::dynamic(fn(int $n) => $firstCompound($n, 'grand-mère', 'de la '))->parent()->ancestor()->female(), |
|
| 256 | + Relationship::dynamic(fn(int $n) => $firstCompound($n, 'grand-père', 'du '))->parent()->ancestor()->male(), |
|
| 257 | + Relationship::dynamic(fn(int $n) => $firstCompound($n, 'grand-parent', 'du '))->parent()->ancestor(), |
|
| 259 | 258 | // Grandchildren and below |
| 260 | - Relationship::dynamic(fn (int $n) => $firstCompound($n, 'petite-fille', 'de la '))->child()->descendant()->female(), |
|
| 261 | - Relationship::dynamic(fn (int $n) => $firstCompound($n, 'petit-fils', 'du '))->child()->descendant()->male(), |
|
| 262 | - Relationship::dynamic(fn (int $n) => $firstCompound($n, 'petit-enfant', 'du '))->child()->descendant(), |
|
| 259 | + Relationship::dynamic(fn(int $n) => $firstCompound($n, 'petite-fille', 'de la '))->child()->descendant()->female(), |
|
| 260 | + Relationship::dynamic(fn(int $n) => $firstCompound($n, 'petit-fils', 'du '))->child()->descendant()->male(), |
|
| 261 | + Relationship::dynamic(fn(int $n) => $firstCompound($n, 'petit-enfant', 'du '))->child()->descendant(), |
|
| 263 | 262 | // Collateral relatives |
| 264 | - Relationship::dynamic(fn (int $n) => $compound($n, 'grand-', 'tante', 'de la ', 'de la '))->ancestor()->sister(), |
|
| 265 | - Relationship::dynamic(fn (int $n) => $compound($n, 'grand-', 'tante par alliance', 'de la ', 'de la '))->ancestor()->sibling()->wife(), |
|
| 266 | - Relationship::dynamic(fn (int $n) => $compound($n, 'grand-', 'oncle', 'de l’', 'du '))->ancestor()->brother(), |
|
| 267 | - Relationship::dynamic(fn (int $n) => $compound($n, 'grand-', 'oncle par alliance', 'de l’', 'du '))->ancestor()->sibling()->husband(), |
|
| 268 | - Relationship::dynamic(fn (int $n) => $compound($n, 'petite-', 'nièce', 'de la ', 'de la '))->sibling()->descendant()->female(), |
|
| 269 | - Relationship::dynamic(fn (int $n) => $compound($n, 'petite-', 'nièce par alliance', 'de la ', 'de la '))->married()->spouse()->sibling()->descendant()->female(), |
|
| 270 | - Relationship::dynamic(fn (int $n) => $compound($n, 'petit-', 'neveu', 'du ', 'du '))->sibling()->descendant()->male(), |
|
| 271 | - Relationship::dynamic(fn (int $n) => $compound($n, 'petit-', 'neveu par alliance', 'du ', 'du '))->married()->spouse()->sibling()->descendant()->male(), |
|
| 263 | + Relationship::dynamic(fn(int $n) => $compound($n, 'grand-', 'tante', 'de la ', 'de la '))->ancestor()->sister(), |
|
| 264 | + Relationship::dynamic(fn(int $n) => $compound($n, 'grand-', 'tante par alliance', 'de la ', 'de la '))->ancestor()->sibling()->wife(), |
|
| 265 | + Relationship::dynamic(fn(int $n) => $compound($n, 'grand-', 'oncle', 'de l’', 'du '))->ancestor()->brother(), |
|
| 266 | + Relationship::dynamic(fn(int $n) => $compound($n, 'grand-', 'oncle par alliance', 'de l’', 'du '))->ancestor()->sibling()->husband(), |
|
| 267 | + Relationship::dynamic(fn(int $n) => $compound($n, 'petite-', 'nièce', 'de la ', 'de la '))->sibling()->descendant()->female(), |
|
| 268 | + Relationship::dynamic(fn(int $n) => $compound($n, 'petite-', 'nièce par alliance', 'de la ', 'de la '))->married()->spouse()->sibling()->descendant()->female(), |
|
| 269 | + Relationship::dynamic(fn(int $n) => $compound($n, 'petit-', 'neveu', 'du ', 'du '))->sibling()->descendant()->male(), |
|
| 270 | + Relationship::dynamic(fn(int $n) => $compound($n, 'petit-', 'neveu par alliance', 'du ', 'du '))->married()->spouse()->sibling()->descendant()->male(), |
|
| 272 | 271 | // Cousins (based on canon law) |
| 273 | - Relationship::dynamic(fn (int $up, int $down) => $cousin($up, $down, 'F'))->cousin()->female(), |
|
| 274 | - Relationship::dynamic(fn (int $up, int $down) => $cousin($up, $down, 'M'))->cousin()->male(), |
|
| 272 | + Relationship::dynamic(fn(int $up, int $down) => $cousin($up, $down, 'F'))->cousin()->female(), |
|
| 273 | + Relationship::dynamic(fn(int $up, int $down) => $cousin($up, $down, 'M'))->cousin()->male(), |
|
| 275 | 274 | |
| 276 | 275 | ]; |
| 277 | 276 | } |
@@ -139,11 +139,11 @@ |
||
| 139 | 139 | $content = FunctionsPrintLists::surnameTagCloud($all_surnames, $module, true, $tree); |
| 140 | 140 | break; |
| 141 | 141 | case 'list': |
| 142 | - uasort($all_surnames, fn (array $a, array $b): int => array_sum($b) <=> array_sum($a)); |
|
| 142 | + uasort($all_surnames, fn(array $a, array $b): int => array_sum($b) <=> array_sum($a)); |
|
| 143 | 143 | $content = FunctionsPrintLists::surnameList($all_surnames, 1, true, $module, $tree); |
| 144 | 144 | break; |
| 145 | 145 | case 'array': |
| 146 | - uasort($all_surnames, fn (array $a, array $b): int => array_sum($b) <=> array_sum($a)); |
|
| 146 | + uasort($all_surnames, fn(array $a, array $b): int => array_sum($b) <=> array_sum($a)); |
|
| 147 | 147 | $content = FunctionsPrintLists::surnameList($all_surnames, 2, true, $module, $tree); |
| 148 | 148 | break; |
| 149 | 149 | case 'table': |
@@ -68,7 +68,7 @@ |
||
| 68 | 68 | $path = (string) parse_url($url, PHP_URL_PATH); |
| 69 | 69 | |
| 70 | 70 | // Paths containing UTF-8 characters need special handling. |
| 71 | - $path = implode('/', array_map(fn (string $x): string => rawurlencode($x), explode('/', $path))); |
|
| 71 | + $path = implode('/', array_map(fn(string $x): string => rawurlencode($x), explode('/', $path))); |
|
| 72 | 72 | |
| 73 | 73 | session_name($secure ? self::SECURE_SESSION_NAME : self::SESSION_NAME); |
| 74 | 74 | session_register_shutdown(); |
@@ -66,7 +66,7 @@ |
||
| 66 | 66 | } catch (GuzzleException $ex) { |
| 67 | 67 | // Service down? Quota exceeded? |
| 68 | 68 | // Don't try for another hour. |
| 69 | - $cache->remember($key, fn () => [], 3600); |
|
| 69 | + $cache->remember($key, fn() => [], 3600); |
|
| 70 | 70 | |
| 71 | 71 | return []; |
| 72 | 72 | } |
@@ -138,7 +138,7 @@ discard block |
||
| 138 | 138 | $value = []; |
| 139 | 139 | } |
| 140 | 140 | |
| 141 | - return array_reduce($this->rules, static fn ($value, $rule) => $rule($value), $value); |
|
| 141 | + return array_reduce($this->rules, static fn($value, $rule) => $rule($value), $value); |
|
| 142 | 142 | } |
| 143 | 143 | |
| 144 | 144 | /** |
@@ -156,7 +156,7 @@ discard block |
||
| 156 | 156 | $value = null; |
| 157 | 157 | } |
| 158 | 158 | |
| 159 | - return array_reduce($this->rules, static fn ($value, $rule) => $rule($value), $value); |
|
| 159 | + return array_reduce($this->rules, static fn($value, $rule) => $rule($value), $value); |
|
| 160 | 160 | } |
| 161 | 161 | |
| 162 | 162 | /** |
@@ -172,6 +172,6 @@ discard block |
||
| 172 | 172 | $value = null; |
| 173 | 173 | } |
| 174 | 174 | |
| 175 | - return array_reduce($this->rules, static fn ($value, $rule) => $rule($value), $value); |
|
| 175 | + return array_reduce($this->rules, static fn($value, $rule) => $rule($value), $value); |
|
| 176 | 176 | } |
| 177 | 177 | } |