diff --git a/composer.json b/composer.json index c47541a..9a5f213 100644 --- a/composer.json +++ b/composer.json @@ -18,7 +18,7 @@ } ], "require": { - "php": ">=7.2", + "php": ">=8.0", "composer/installers": "^1.0 || ^2.0" }, "require-dev": { diff --git a/console/command/repair_tags.php b/console/command/repair_tags.php index 25ab1cf..a42c927 100644 --- a/console/command/repair_tags.php +++ b/console/command/repair_tags.php @@ -342,7 +342,7 @@ protected function ask_replacements(SymfonyStyle $io, string $source_name): arra * @param array $catalog Tag catalog * @return int|null Selected target identifier, or null when cancelled */ - protected function ask_merge_target(SymfonyStyle $io, int $source_id, array $catalog): ?int + protected function ask_merge_target(SymfonyStyle $io, int $source_id, array $catalog): int|null { $target_ids = []; $choices = []; diff --git a/tags/manager.php b/tags/manager.php index 6fbc05b..774fb2d 100644 --- a/tags/manager.php +++ b/tags/manager.php @@ -57,7 +57,7 @@ class manager * @param string $forums_table Forums table * @param cache|null $cache Cache driver */ - public function __construct(driver_interface $db, string $tags_table, string $forums_map_table, string $topic_map_table, string $forums_table, ?cache $cache = null) + public function __construct(driver_interface $db, string $tags_table, string $forums_map_table, string $topic_map_table, string $forums_table, cache|null $cache = null) { $this->db = $db; $this->tags_table = $tags_table; diff --git a/tags/reply_repairer.php b/tags/reply_repairer.php index 91dc155..55f4aa2 100644 --- a/tags/reply_repairer.php +++ b/tags/reply_repairer.php @@ -178,7 +178,7 @@ protected function reply_plan_from_row( array $tag_ids, array $posts, array $forum_caches - ): ?array + ): array|null { $post_id = (int) $row['post_id']; $topic_id = (int) $row['topic_id']; diff --git a/tags/title_repairer.php b/tags/title_repairer.php index ab3d970..36c7c44 100644 --- a/tags/title_repairer.php +++ b/tags/title_repairer.php @@ -288,7 +288,7 @@ protected function load_forum_caches(array $topics): array * @return array|null Repair snapshot, or null when the topic is unmatched * @throws \InvalidArgumentException When the prefix is invalid */ - protected function plan_from_row(array $row, string $prefix, array $posts, array $forum_caches): ?array + protected function plan_from_row(array $row, string $prefix, array $posts, array $forum_caches): array|null { $topic_id = (int) $row['topic_id']; $forum_id = (int) $row['forum_id']; @@ -857,7 +857,7 @@ protected function literal(string $text): string * @param string $sql SQL query * @return array|null First row, or null when no row exists */ - protected function fetch(string $sql): ?array + protected function fetch(string $sql): array|null { $result = $this->db->sql_query($sql); $row = $this->db->sql_fetchrow($result); diff --git a/tags/topic_repairer.php b/tags/topic_repairer.php index aa111a1..5e98b75 100644 --- a/tags/topic_repairer.php +++ b/tags/topic_repairer.php @@ -200,7 +200,7 @@ protected function get_forum_tags(int $forum_id): array * @param array $tags Tag rows available in the topic's forum * @return array|null Matched prefix and tags, or null when no prefix matches */ - protected function match_prefix(string $title, array $tags): ?array + protected function match_prefix(string $title, array $tags): array|null { $states = [0 => ['' => []]]; $matches = [];