@@ -101,7 +101,7 @@ discard block |
||
| 101 | 101 | $rows = $query |
| 102 | 102 | ->groupBy(['n_givn']) |
| 103 | 103 | ->pluck(new Expression('COUNT(DISTINCT n_id) AS total'), 'n_givn') |
| 104 | - ->map(static fn (int|string $count): int => (int) $count); |
|
| 104 | + ->map(static fn (int | string $count): int => (int) $count); |
|
| 105 | 105 | |
| 106 | 106 | |
| 107 | 107 | $given_names = []; |
@@ -784,7 +784,7 @@ discard block |
||
| 784 | 784 | * |
| 785 | 785 | * @return object{id:string,year:int,fact:string,type:string}|null |
| 786 | 786 | */ |
| 787 | - private function firstEvent(array $events, bool $ascending): object|null |
|
| 787 | + private function firstEvent(array $events, bool $ascending): object | null |
|
| 788 | 788 | { |
| 789 | 789 | if ($events === []) { |
| 790 | 790 | $events = [ |
@@ -803,7 +803,7 @@ discard block |
||
| 803 | 803 | ->orderBy('d_julianday1', $ascending ? 'ASC' : 'DESC') |
| 804 | 804 | ->limit(1) |
| 805 | 805 | ->get() |
| 806 | - ->map(static fn (object $row): object => (object) [ |
|
| 806 | + ->map(static fn (object $row) : object => (object) [ |
|
| 807 | 807 | 'id' => $row->id, |
| 808 | 808 | 'year' => (int) $row->year, |
| 809 | 809 | 'fact' => $row->fact, |
@@ -916,14 +916,14 @@ discard block |
||
| 916 | 916 | return $date->display(); |
| 917 | 917 | } |
| 918 | 918 | |
| 919 | - public function isUserLoggedIn(int|null $user_id): bool |
|
| 919 | + public function isUserLoggedIn(int | null $user_id): bool |
|
| 920 | 920 | { |
| 921 | 921 | return $user_id !== null && DB::table('session') |
| 922 | 922 | ->where('user_id', '=', $user_id) |
| 923 | 923 | ->exists(); |
| 924 | 924 | } |
| 925 | 925 | |
| 926 | - public function latestUserId(): int|null |
|
| 926 | + public function latestUserId(): int | null |
|
| 927 | 927 | { |
| 928 | 928 | $user_id = DB::table('user') |
| 929 | 929 | ->select(['user.user_id']) |
@@ -1135,7 +1135,7 @@ discard block |
||
| 1135 | 1135 | /** |
| 1136 | 1136 | * @return object{individual:Individual,days:int}|null |
| 1137 | 1137 | */ |
| 1138 | - public function longlifeQuery(string $sex): object|null |
|
| 1138 | + public function longlifeQuery(string $sex): object | null |
|
| 1139 | 1139 | { |
| 1140 | 1140 | return $this->birthAndDeathQuery($sex) |
| 1141 | 1141 | ->orderBy('days', 'desc') |
@@ -58,7 +58,7 @@ |
||
| 58 | 58 | ) { |
| 59 | 59 | } |
| 60 | 60 | |
| 61 | - public function pendingChangesExist(Tree|null $tree = null): bool |
|
| 61 | + public function pendingChangesExist(Tree | null $tree = null): bool |
|
| 62 | 62 | { |
| 63 | 63 | $query = DB::table(table: 'change')->where(column: 'status', operator: '=', value: 'pending'); |
| 64 | 64 | |
@@ -39,7 +39,7 @@ |
||
| 39 | 39 | use ModuleMapProviderTrait; |
| 40 | 40 | |
| 41 | 41 | // This list comes from https://image.maps.hereapi.com/mia/v3/languages?apiKey={YOUR_API_KEY} |
| 42 | - private const array LANGUAGE_CODES = ["ar","as","az","be","bg","bn","bs","ca","cs","cy","da","de","el","en","es","et","eu","fi","fo","fr","ga","gl","gn","gu","he","hi","hr","hu","hy","id","is","it","ja","ka","kk","km","kn","ko","ky","lt","lv","mk","ml","mr","ms","mt","my","nl","no","or","pa","pl","pt","ro","ru","sk","sl","sq","sr","sv","ta","te","th","tr","uk","uz","vi","zh","zh-Hant"]; |
|
| 42 | + private const array LANGUAGE_CODES = ["ar", "as", "az", "be", "bg", "bn", "bs", "ca", "cs", "cy", "da", "de", "el", "en", "es", "et", "eu", "fi", "fo", "fr", "ga", "gl", "gn", "gu", "he", "hi", "hr", "hu", "hy", "id", "is", "it", "ja", "ka", "kk", "km", "kn", "ko", "ky", "lt", "lv", "mk", "ml", "mr", "ms", "mt", "my", "nl", "no", "or", "pa", "pl", "pt", "ro", "ru", "sk", "sl", "sq", "sr", "sv", "ta", "te", "th", "tr", "uk", "uz", "vi", "zh", "zh-Hant"]; |
|
| 43 | 43 | |
| 44 | 44 | /** |
| 45 | 45 | * Name of the map provider. |
@@ -49,33 +49,33 @@ |
||
| 49 | 49 | */ |
| 50 | 50 | public function __construct( |
| 51 | 51 | public string $name, |
| 52 | - Column|Index|ForeignKeyConstraint|PrimaryKeyConstraint ...$components, |
|
| 52 | + Column | Index | ForeignKeyConstraint | PrimaryKeyConstraint ...$components, |
|
| 53 | 53 | ) { |
| 54 | 54 | $this->columns = array_values( |
| 55 | 55 | array: array_filter( |
| 56 | 56 | array: $components, |
| 57 | - callback: static fn (Column|Index|ForeignKeyConstraint|PrimaryKeyConstraint $component): bool => $component instanceof Column, |
|
| 57 | + callback: static fn (Column | Index | ForeignKeyConstraint | PrimaryKeyConstraint $component): bool => $component instanceof Column, |
|
| 58 | 58 | ) |
| 59 | 59 | ); |
| 60 | 60 | |
| 61 | 61 | $this->primary_keys = array_values( |
| 62 | 62 | array: array_filter( |
| 63 | 63 | array: $components, |
| 64 | - callback: static fn (Column|Index|ForeignKeyConstraint|PrimaryKeyConstraint $component): bool => $component instanceof PrimaryKeyConstraint, |
|
| 64 | + callback: static fn (Column | Index | ForeignKeyConstraint | PrimaryKeyConstraint $component): bool => $component instanceof PrimaryKeyConstraint, |
|
| 65 | 65 | ) |
| 66 | 66 | ); |
| 67 | 67 | |
| 68 | 68 | $this->indexes = array_values( |
| 69 | 69 | array: array_filter( |
| 70 | 70 | array: $components, |
| 71 | - callback: static fn (Column|Index|ForeignKeyConstraint|PrimaryKeyConstraint $component): bool => $component instanceof Index, |
|
| 71 | + callback: static fn (Column | Index | ForeignKeyConstraint | PrimaryKeyConstraint $component): bool => $component instanceof Index, |
|
| 72 | 72 | ) |
| 73 | 73 | ); |
| 74 | 74 | |
| 75 | 75 | $this->foreign_keys = array_values( |
| 76 | 76 | array: array_filter( |
| 77 | 77 | array: $components, |
| 78 | - callback: static fn (Column|Index|ForeignKeyConstraint|PrimaryKeyConstraint $component): bool => $component instanceof ForeignKeyConstraint, |
|
| 78 | + callback: static fn (Column | Index | ForeignKeyConstraint | PrimaryKeyConstraint $component): bool => $component instanceof ForeignKeyConstraint, |
|
| 79 | 79 | ) |
| 80 | 80 | ); |
| 81 | 81 | } |
@@ -32,7 +32,7 @@ |
||
| 32 | 32 | * @param non-empty-string|null $alias |
| 33 | 33 | * |
| 34 | 34 | */ |
| 35 | - public function from(string $table, string|null $alias = null): self |
|
| 35 | + public function from(string $table, string | null $alias = null): self |
|
| 36 | 36 | { |
| 37 | 37 | return parent::from(table: DB::prefix($table), alias: $alias ?? $table); |
| 38 | 38 | } |
@@ -212,7 +212,7 @@ discard block |
||
| 212 | 212 | return self::pdo()->getAttribute(PDO::ATTR_DRIVER_NAME); |
| 213 | 213 | } |
| 214 | 214 | |
| 215 | - public static function exec(string $sql): int|false |
|
| 215 | + public static function exec(string $sql): int | false |
|
| 216 | 216 | { |
| 217 | 217 | return self::pdo()->exec($sql); |
| 218 | 218 | } |
@@ -304,7 +304,7 @@ discard block |
||
| 304 | 304 | /** |
| 305 | 305 | * @return Expression<string> |
| 306 | 306 | */ |
| 307 | - public static function binaryColumn(string $column, string|null $alias = null): Expression |
|
| 307 | + public static function binaryColumn(string $column, string | null $alias = null): Expression |
|
| 308 | 308 | { |
| 309 | 309 | if (self::driverName() === self::MYSQL) { |
| 310 | 310 | $sql = 'CAST(' . $column . ' AS binary)'; |
@@ -370,7 +370,7 @@ discard block |
||
| 370 | 370 | /** |
| 371 | 371 | * @param non-empty-string $name |
| 372 | 372 | */ |
| 373 | - public static function char(string $name, int $length, bool $nullable = false, string|null $default = null): Column |
|
| 373 | + public static function char(string $name, int $length, bool $nullable = false, string | null $default = null): Column |
|
| 374 | 374 | { |
| 375 | 375 | return Column::editor() |
| 376 | 376 | ->setUnquotedName($name) |
@@ -386,7 +386,7 @@ discard block |
||
| 386 | 386 | /** |
| 387 | 387 | * @param non-empty-string $name |
| 388 | 388 | */ |
| 389 | - public static function varchar(string $name, int $length, bool $nullable = false, string|null $default = null): Column |
|
| 389 | + public static function varchar(string $name, int $length, bool $nullable = false, string | null $default = null): Column |
|
| 390 | 390 | { |
| 391 | 391 | return Column::editor() |
| 392 | 392 | ->setUnquotedName($name) |
@@ -402,7 +402,7 @@ discard block |
||
| 402 | 402 | /** |
| 403 | 403 | * @param non-empty-string $name |
| 404 | 404 | */ |
| 405 | - public static function nchar(string $name, int $length, bool $nullable = false, string|null $default = null): Column |
|
| 405 | + public static function nchar(string $name, int $length, bool $nullable = false, string | null $default = null): Column |
|
| 406 | 406 | { |
| 407 | 407 | return Column::editor() |
| 408 | 408 | ->setUnquotedName($name) |
@@ -418,7 +418,7 @@ discard block |
||
| 418 | 418 | /** |
| 419 | 419 | * @param non-empty-string $name |
| 420 | 420 | */ |
| 421 | - public static function nvarchar(string $name, int $length, bool $nullable = false, string|null $default = null): Column |
|
| 421 | + public static function nvarchar(string $name, int $length, bool $nullable = false, string | null $default = null): Column |
|
| 422 | 422 | { |
| 423 | 423 | return Column::editor() |
| 424 | 424 | ->setUnquotedName($name) |
@@ -434,7 +434,7 @@ discard block |
||
| 434 | 434 | /** |
| 435 | 435 | * @param non-empty-string $name |
| 436 | 436 | */ |
| 437 | - public static function integer(string $name, bool $autoincrement = false, bool $nullable = false, int|null $default = null): Column |
|
| 437 | + public static function integer(string $name, bool $autoincrement = false, bool $nullable = false, int | null $default = null): Column |
|
| 438 | 438 | { |
| 439 | 439 | return Column::editor() |
| 440 | 440 | ->setUnquotedName($name) |
@@ -472,7 +472,7 @@ discard block |
||
| 472 | 472 | /** |
| 473 | 473 | * @param non-empty-string $name |
| 474 | 474 | */ |
| 475 | - public static function timestamp(string $name, int $precision = 0, string|null $default = null): Column |
|
| 475 | + public static function timestamp(string $name, int $precision = 0, string | null $default = null): Column |
|
| 476 | 476 | { |
| 477 | 477 | return Column::editor() |
| 478 | 478 | ->setUnquotedName($name) |
@@ -527,7 +527,7 @@ discard block |
||
| 527 | 527 | string $name, |
| 528 | 528 | array $local_columns, |
| 529 | 529 | string $foreign_table, |
| 530 | - array|null $foreign_columns = null, |
|
| 530 | + array | null $foreign_columns = null, |
|
| 531 | 531 | ReferentialAction $on_delete = ReferentialAction::NO_ACTION, |
| 532 | 532 | ReferentialAction $on_update = ReferentialAction::NO_ACTION, |
| 533 | 533 | ): ForeignKeyConstraint { |