From d10d61bd7a686d0c04a1ea76b665197800af0e82 Mon Sep 17 00:00:00 2001 From: Brian Foley Date: Fri, 16 Oct 2026 13:41:57 +0100 Subject: [PATCH 1/4] api/*: Prefix unused function param names with _. So PHPStan 2.3 can ignore them. This naming convention is used in the Rust compiler & in Python linters. --- api/v1_docs.inc | 10 +++---- api/v1_projects.inc | 64 +++++++++++++++++++++---------------------- api/v1_queues.inc | 10 +++---- api/v1_stats.inc | 22 +++++++-------- api/v1_storage.inc | 2 +- api/v1_validators.inc | 4 +-- 6 files changed, 56 insertions(+), 56 deletions(-) diff --git a/api/v1_docs.inc b/api/v1_docs.inc index 330c10f00..7311c8023 100755 --- a/api/v1_docs.inc +++ b/api/v1_docs.inc @@ -3,12 +3,12 @@ include_once($relPath.'faq.inc'); include_once("api_common.inc"); /** - * @param array $data + * @param array $_data * @param array $query_params * @return string[] * List of document IDs */ -function api_v1_documents(string $method, array $data, array $query_params): array +function api_v1_documents(string $_method, array $_data, array $query_params): array { global $external_faq_overrides; @@ -32,7 +32,7 @@ function api_v1_documents(string $method, array $data, array $query_params): arr * @param array $data * @param array $query_params */ -function api_v1_document(string $method, array $data, array $query_params): string +function api_v1_document(string $_method, array $data, array $query_params): string { $lang_code = $query_params["language_code"] ?? "en"; $document = $data[":document"]; @@ -45,10 +45,10 @@ function api_v1_document(string $method, array $data, array $query_params): stri } /** - * @param array $data + * @param array $_data * @return array */ -function api_v1_dictionaries(string $method, array $data): array +function api_v1_dictionaries(string $_method, array $_data): array { $dict_list = get_languages_with_dictionaries(); asort($dict_list); diff --git a/api/v1_projects.inc b/api/v1_projects.inc index 70e842b71..f0452d5fd 100644 --- a/api/v1_projects.inc +++ b/api/v1_projects.inc @@ -42,11 +42,11 @@ function get_return_fields(array $query_params, ?Project $project): ?array } /** - * @param array $data + * @param array $_data * @param array $query_params * @return array[] */ -function api_v1_projects(string $method, array $data, array $query_params): array +function api_v1_projects(string $_method, array $_data, array $query_params): array { // set which fields are queryable and their column names $valid_fields = get_project_fields_with_attr("queryable", null); @@ -403,7 +403,7 @@ function render_project_json(Project $project, ?array $return_fields = null): ar * @param array $data * @return array{stage: string, name: string, url:string}[] */ -function api_v1_project_artifacts(string $method, array $data): array +function api_v1_project_artifacts(string $_method, array $data): array { // get the project and the stage $project = $data[":projectid"]; @@ -531,7 +531,7 @@ function api_v1_project_holdstates(string $method, array $data): array * @param array $data * @return array{image: string, image_url: string, image_size: int}[] */ -function api_v1_project_pages(string $method, array $data): array +function api_v1_project_pages(string $_method, array $data): array { $project = $data[":projectid"]; @@ -558,7 +558,7 @@ function api_v1_project_pages(string $method, array $data): array * @param array $query_params * @return array[] */ -function api_v1_project_pagedetails(string $method, array $data, array $query_params): array +function api_v1_project_pagedetails(string $_method, array $data, array $query_params): array { // optional page round IDs (one or more) to filter down to $only_rounds = null; @@ -618,7 +618,7 @@ function api_v1_project_pagedetails(string $method, array $data, array $query_pa * @param array $data * @return array */ -function api_v1_project_page_round(string $method, array $data): array +function api_v1_project_page_round(string $_method, array $data): array { if ($data[":pageroundid"] == "OCR") { $text_column = "master_text"; @@ -685,7 +685,7 @@ function render_project_page_json(array $row): array * @param array $data * @return array{timestamp: string, event_type: string, details: string[]}[] */ -function api_v1_project_transitions(string $method, array $data): array +function api_v1_project_transitions(string $_method, array $data): array { $sql = sprintf( " @@ -713,10 +713,10 @@ function api_v1_project_transitions(string $method, array $data): array // projects/difficulties /** - * @param array $data + * @param array $_data * @return string[] */ -function api_v1_projects_difficulties(string $method, array $data): array +function api_v1_projects_difficulties(string $_method, array $_data): array { $difficulties = get_project_difficulties(); return array_keys($difficulties); @@ -726,10 +726,10 @@ function api_v1_projects_difficulties(string $method, array $data): array // projects/genres /** - * @param array $data + * @param array $_data * @return string[] */ -function api_v1_projects_genres(string $method, array $data): array +function api_v1_projects_genres(string $_method, array $_data): array { $genres = ProjectSearchForm::genre_options(); unset($genres['']); @@ -740,10 +740,10 @@ function api_v1_projects_genres(string $method, array $data): array // projects/languages /** - * @param array $data + * @param array $_data * @return string[] */ -function api_v1_projects_languages(string $method, array $data): array +function api_v1_projects_languages(string $_method, array $_data): array { $languages = ProjectSearchForm::language_options(); unset($languages['']); @@ -754,10 +754,10 @@ function api_v1_projects_languages(string $method, array $data): array // projects/states /** - * @param array $data + * @param array $_data * @return string[] */ -function api_v1_projects_states(string $method, array $data): array +function api_v1_projects_states(string $_method, array $_data): array { $states = ProjectSearchForm::state_options(); unset($states['']); @@ -768,10 +768,10 @@ function api_v1_projects_states(string $method, array $data): array // projects/pagerounds /** - * @param array $data + * @param array $_data * @return string[] */ -function api_v1_projects_pagerounds(string $method, array $data): array +function api_v1_projects_pagerounds(string $_method, array $_data): array { return array_merge(["OCR"], Rounds::get_ids()); } @@ -780,11 +780,11 @@ function api_v1_projects_pagerounds(string $method, array $data): array // projects/charsuites /** - * @param array $data + * @param array $_data * @param array $query_params * @return array{id: string, name: string, characters: (string|null)[], enabled: bool}[] */ -function api_v1_projects_charsuites(string $method, array $data, array $query_params): array +function api_v1_projects_charsuites(string $_method, array $_data, array $query_params): array { $enabled_filter = _get_enabled_filter($query_params); if ($enabled_filter === null) { @@ -814,7 +814,7 @@ function api_v1_projects_charsuites(string $method, array $data, array $query_pa // projects/specialdays /** - * @param array $data + * @param array $_data * @param array $query_params * @return array{ * id: string, @@ -831,7 +831,7 @@ function api_v1_projects_charsuites(string $method, array $data, array $query_pa * enabled: bool * }[] */ -function api_v1_projects_specialdays(string $method, array $data, array $query_params): array +function api_v1_projects_specialdays(string $_method, array $_data, array $query_params): array { $return_data = []; @@ -866,7 +866,7 @@ function api_v1_projects_specialdays(string $method, array $data, array $query_p // projects/imagesources /** - * @param array $data + * @param array $_data * @param array $query_params * @return array{ * id: string, @@ -877,7 +877,7 @@ function api_v1_projects_specialdays(string $method, array $data, array $query_p * enabled: bool * }[] */ -function api_v1_projects_imagesources(string $method, array $data, array $query_params): array +function api_v1_projects_imagesources(string $_method, array $_data, array $query_params): array { $return_data = []; @@ -913,10 +913,10 @@ function api_v1_projects_imagesources(string $method, array $data, array $query_ // projects/holdstates /** - * @param array $data + * @param array $_data * @return string[] */ -function api_v1_projects_holdstates(string $method, array $data): array +function api_v1_projects_holdstates(string $_method, array $_data): array { return Project::get_holdable_states(); } @@ -948,7 +948,7 @@ function _get_enabled_filter(array $query_params): ?bool * @param array $query_params * @return array */ -function api_v1_project_checkout(string $method, array $data, array $query_params): array +function api_v1_project_checkout(string $_method, array $data, array $query_params): array { try { $project = $data[":projectid"]; @@ -967,7 +967,7 @@ function api_v1_project_checkout(string $method, array $data, array $query_param * @param array $data * @return array{invalid_chars: array} */ -function api_v1_project_validatetext(string $method, array $data): array +function api_v1_project_validatetext(string $_method, array $data): array { $project = $data[":projectid"]; $invalid_characters = $project->find_invalid_characters(receive_project_text_from_request_body()); @@ -978,7 +978,7 @@ function api_v1_project_validatetext(string $method, array $data): array * @param array $data * @return array{bad_words: array, messages: string[]} */ -function api_v1_project_wordcheck(string $method, array $data): array +function api_v1_project_wordcheck(string $_method, array $data): array { $project = $data[":projectid"]; $accepted_words = receive_data_from_request_body("accepted_words") ?? []; @@ -1006,7 +1006,7 @@ function api_v1_project_wordcheck(string $method, array $data): array * }[] * }[] */ -function api_v1_project_pickersets(string $method, array $data): array +function api_v1_project_pickersets(string $_method, array $data): array { $project = $data[":projectid"]; send_cache_header(60 * 60, "public"); @@ -1070,7 +1070,7 @@ function api_v1_project_page(string $method, array $data, array $query_params) } /** @param array $data */ -function api_v1_project_page_format_preview(string $method, array $data): void +function api_v1_project_page_format_preview(string $_method, array $data): void { try { $project = $data[":projectid"]; @@ -1088,7 +1088,7 @@ function api_v1_project_page_format_preview(string $method, array $data): void } /** @param array $data */ -function api_v1_project_page_report_bad(string $method, array $data): void +function api_v1_project_page_report_bad(string $_method, array $data): void { global $pguser, $PAGE_BADNESS_REASONS; @@ -1117,7 +1117,7 @@ function api_v1_project_page_report_bad(string $method, array $data): void } /** @param array $data */ -function api_v1_project_page_wordcheck(string $method, array $data): void +function api_v1_project_page_wordcheck(string $_method, array $data): void { try { $project = $data[":projectid"]; diff --git a/api/v1_queues.inc b/api/v1_queues.inc index da6ef50d9..c76c4607f 100644 --- a/api/v1_queues.inc +++ b/api/v1_queues.inc @@ -9,11 +9,11 @@ include_once("api_common.inc"); //--------------------------------------------------------------------------- // queues -- list queues, optionally filtered by round /** - * @param array $data + * @param array $_data * @param array $query_params * @return array[] */ -function api_v1_queues(string $method, array $data, array $query_params): array +function api_v1_queues(string $_method, array $_data, array $query_params): array { $roundid = $query_params["roundid"] ?? null; $round = !is_null($roundid) ? validate_round($roundid, []) : null; @@ -65,7 +65,7 @@ function api_v1_queues(string $method, array $data, array $query_params): array * @param array $data * @return array */ -function api_v1_queue(string $method, array $data): array +function api_v1_queue(string $_method, array $data): array { $queue = $data[":queueid"]; @@ -79,7 +79,7 @@ function api_v1_queue(string $method, array $data): array * @param array $data * @return array */ -function api_v1_queue_stats(string $method, array $data): array +function api_v1_queue_stats(string $_method, array $data): array { $queue = $data[":queueid"]; @@ -97,7 +97,7 @@ function api_v1_queue_stats(string $method, array $data): array * @param array $query_params * @return array[] */ -function api_v1_queue_projects(string $method, array $data, array $query_params): array +function api_v1_queue_projects(string $_method, array $data, array $query_params): array { $queue = $data[":queueid"]; $unheld_only = (bool) get_flag_value($query_params, "unheld_only"); diff --git a/api/v1_stats.inc b/api/v1_stats.inc index 0d6bf7d63..0ded27cff 100644 --- a/api/v1_stats.inc +++ b/api/v1_stats.inc @@ -7,10 +7,10 @@ include_once("exceptions.inc"); // stats/site /** - * @param array $data + * @param array $_data * @return array{server_time: string, ...} */ -function api_v1_stats_site(string $method, array $data): array +function api_v1_stats_site(string $_method, array $_data): array { $res = DPDatabase::query("SELECT COUNT(*) FROM users"); [$registered_users] = mysqli_fetch_row($res); @@ -59,10 +59,10 @@ function api_v1_stats_site(string $method, array $data): array * "proj_post_second_checked_out": 2, * "proj_delete": 46, * }``` - * @param array $data + * @param array $_data * @return array */ -function api_v1_stats_site_projects_states(string $method, array $data): array +function api_v1_stats_site_projects_states(string $_method, array $_data): array { // Make sure all project state statistics are provided. $output = []; @@ -84,10 +84,10 @@ function api_v1_stats_site_projects_states(string $method, array $data): array } /** - * @param array $data + * @param array $_data * @return array */ -function api_v1_stats_site_projects_stages(string $method, array $data): array +function api_v1_stats_site_projects_stages(string $_method, array $_data): array { // Make sure all project stage statistics are provided. $output = []; @@ -151,10 +151,10 @@ function render_round_stats(string $round_id): array } /** - * @param array $data + * @param array $_data * @return array> */ -function api_v1_stats_site_rounds(string $method, array $data): array +function api_v1_stats_site_rounds(string $_method, array $_data): array { $return = []; foreach (Rounds::get_ids() as $round_id) { @@ -171,7 +171,7 @@ function api_v1_stats_site_rounds(string $method, array $data): array * @param array $data * @return array */ -function api_v1_stats_site_round(string $method, array $data): array +function api_v1_stats_site_round(string $_method, array $data): array { $round = $data[":roundid"]; @@ -211,7 +211,7 @@ function render_round_user_stats(User $user, Round $round): array * @param array $data * @return array> */ -function api_v1_stats_user_rounds(string $method, array $data): array +function api_v1_stats_user_rounds(string $_method, array $data): array { $user = $data[":username"]; @@ -230,7 +230,7 @@ function api_v1_stats_user_rounds(string $method, array $data): array * @param array $data * @return array */ -function api_v1_stats_user_round(string $method, array $data): array +function api_v1_stats_user_round(string $_method, array $data): array { $user = $data[":username"]; $round = $data[":roundid"]; diff --git a/api/v1_storage.inc b/api/v1_storage.inc index 0192223c5..fa48723bb 100644 --- a/api/v1_storage.inc +++ b/api/v1_storage.inc @@ -34,7 +34,7 @@ function api_v1_storage(string $method, array $data): mixed } /** @param array $data */ -function api_v1_storage_delete(string $method, array $data): void +function api_v1_storage_delete(string $_method, array $data): void { global $pguser; diff --git a/api/v1_validators.inc b/api/v1_validators.inc index b492de6c9..6dd4e8dd0 100644 --- a/api/v1_validators.inc +++ b/api/v1_validators.inc @@ -101,8 +101,8 @@ function validate_document(string $document): string return $document; } -/** @param array $data */ -function validate_storage_key(string $storage_key, array $data): string +/** @param array $_data */ +function validate_storage_key(string $storage_key, array $_data): string { if (!in_array($storage_key, SiteConfig::get()->api_storage_keys)) { throw new NotFoundError("$storage_key is not a valid storage key"); From 76ecb86a55c53597a88e6aa22e747b57e0051ff6 Mon Sep 17 00:00:00 2001 From: Brian Foley Date: Fri, 16 Oct 2026 13:46:24 +0100 Subject: [PATCH 2/4] ProjectTransition: Prefix unused collateral_actions func params with _ --- pinc/ProjectTransition.inc | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/pinc/ProjectTransition.inc b/pinc/ProjectTransition.inc index c9b6c9571..51627f477 100644 --- a/pinc/ProjectTransition.inc +++ b/pinc/ProjectTransition.inc @@ -1138,7 +1138,7 @@ function create_project_transitions(): array // The functions below are used as callbacks for ProjectTransitions, either // as the project_restriction or the collateral_actions. -function round_release_collateral(Project $old_project, Project $project, ProjectTransition $transition, string $who): void +function round_release_collateral(Project $_old_project, Project $project, ProjectTransition $transition, string $who): void { $round = get_Round_for_project_state($transition->to_state); assert(!is_null($round)); @@ -1178,7 +1178,7 @@ function round_release_collateral(Project $old_project, Project $project, Projec } } -function bad_project_collateral(Project $old_project, Project $project, ProjectTransition $transition, string $who): void +function bad_project_collateral(Project $_old_project, Project $project, ProjectTransition $_transition, string $_who): void { configure_gettext_for_user($project->username); $body_blurb_messages[] = _("This project has been shut down. This is due to 10 or more problem reports, from at least 3 unique users, noting errors or problems with this project."); @@ -1188,7 +1188,7 @@ function bad_project_collateral(Project $old_project, Project $project, ProjectT configure_gettext_for_user(); } -function round_complete_collateral(Project $old_project, Project $project, ProjectTransition $transition, string $who): void +function round_complete_collateral(Project $_old_project, Project $project, ProjectTransition $transition, string $_who): void { $round = get_Round_for_project_state($transition->to_state); assert(!is_null($round)); @@ -1224,7 +1224,7 @@ function proj_would_go_to_PP_out(Project $project, ProjectTransition $transition return !is_null(project_get_auto_PPer($project->projectid)); } -function round_to_PP_avail_collateral(Project $old_project, Project $project, ProjectTransition $transition, string $who): void +function round_to_PP_avail_collateral(Project $old_project, Project $project, ProjectTransition $transition, string $_who): void { $from_round = get_Round_for_project_state($transition->from_state); generate_post_files($project, $from_round->id, 'LE', false, ''); @@ -1265,7 +1265,7 @@ function round_to_PP_avail_collateral(Project $old_project, Project $project, Pr } // From either PP Checked out or PP Unavailable to PP Available -function to_PP_available_collateral(Project $old_project, Project $project, ProjectTransition $transition, string $who): void +function to_PP_available_collateral(Project $_old_project, Project $project, ProjectTransition $transition, string $_who): void { // Always notify the PM configure_gettext_for_user($project->username); @@ -1282,7 +1282,7 @@ function to_PP_available_collateral(Project $old_project, Project $project, Proj notify_project_event_subscribers($project, 'pp_enter'); } -function round_to_PP_out_collateral(Project $old_project, Project $project, ProjectTransition $transition, string $who): void +function round_to_PP_out_collateral(Project $_old_project, Project $project, ProjectTransition $transition, string $_who): void { $from_round = get_Round_for_project_state($transition->from_state); generate_post_files($project, $from_round->id, 'LE', false, ''); @@ -1338,7 +1338,7 @@ function round_to_PP_out_collateral(Project $old_project, Project $project, Proj } // From PP Un/Available to PP Checked out -function PP_to_PP_out_collateral(Project $old_project, Project $project, ProjectTransition $transition, string $who): void +function PP_to_PP_out_collateral(Project $_old_project, Project $project, ProjectTransition $_transition, string $_who): void { // Always notify the PM configure_gettext_for_user($project->username); @@ -1353,12 +1353,12 @@ function PP_to_PP_out_collateral(Project $old_project, Project $project, Project configure_gettext_for_user(); } -function to_PPV_available_collateral(Project $old_project, Project $project, ProjectTransition $transition, string $who): void +function to_PPV_available_collateral(Project $_old_project, Project $project, ProjectTransition $_transition, string $_who): void { notify_project_event_subscribers($project, 'ppv_enter'); } -function return_to_PP_collateral(Project $old_project, Project $project, ProjectTransition $transition, string $who): void +function return_to_PP_collateral(Project $_old_project, Project $project, ProjectTransition $_transition, string $_who): void { $PPer_username = $project->checkedoutby; $PPer = new User($PPer_username); @@ -1385,7 +1385,7 @@ function project_was_not_returned_from_PPV(Project $project, ProjectTransition $ return $project->ppverifier == null; } -function return_from_PP_to_PPV_collateral(Project $old_project, Project $project, ProjectTransition $transition, string $who): void +function return_from_PP_to_PPV_collateral(Project $_old_project, Project $project, ProjectTransition $_transition, string $_who): void { $PPVer_username = $project->checkedoutby; $PPVer = new User($PPVer_username); @@ -1402,7 +1402,7 @@ function return_from_PP_to_PPV_collateral(Project $old_project, Project $project // From either PP Checked out or PP Available to PP Unavailable // Or to Unavailable in a round -function to_unavailable_collateral(Project $old_project, Project $project, ProjectTransition $transition, string $who): void +function to_unavailable_collateral(Project $_old_project, Project $project, ProjectTransition $transition, string $who): void { // Always notify the PM configure_gettext_for_user($project->username); @@ -1418,7 +1418,7 @@ function to_unavailable_collateral(Project $old_project, Project $project, Proje configure_gettext_for_user(); } -function pg_posted_collateral(Project $old_project, Project $project, ProjectTransition $transition, string $who): void +function pg_posted_collateral(Project $_old_project, Project $project, ProjectTransition $_transition, string $_who): void { notify_project_event_subscribers($project, 'posted'); } From 3d33ea87f71ad4d169cf25c6d024400e20aff63a Mon Sep 17 00:00:00 2001 From: Brian Foley Date: Fri, 16 Oct 2026 14:55:06 +0100 Subject: [PATCH 3/4] forum_interface_*: Prefix unused forum func params with _ These functions all need to have the same type signature as functions from PHPBB, so even though these dummy/test functions don't use the parameters, we need to keep them. --- pinc/forum_interface_json.inc | 26 +++++++++++++------------- pinc/forum_interface_phpbb3.inc | 2 +- 2 files changed, 14 insertions(+), 14 deletions(-) diff --git a/pinc/forum_interface_json.inc b/pinc/forum_interface_json.inc index 34bb98479..fc218f673 100644 --- a/pinc/forum_interface_json.inc +++ b/pinc/forum_interface_json.inc @@ -298,7 +298,7 @@ function get_forum_user_id(string $username): ?int } // @phpstan-ignore return.unusedType -function get_forum_rank_title(int $rank): ?string +function get_forum_rank_title(int $_rank): ?string // Given a forum rank number, return the text title of that rank. { return "Tester"; @@ -324,33 +324,33 @@ function get_url_for_forum_user_login(): string return ""; } -function get_url_to_compose_message_to_user(string $username): string +function get_url_to_compose_message_to_user(string $_username): string // Given a forum username, return a URL that can be used to // access a form to send the user a message. { return ""; } -function get_url_to_view_forum(int $forum_id): string +function get_url_to_view_forum(int $_forum_id): string // Given a forum id, return a URL that can be used to view the forum. { return ""; } -function get_url_to_view_topic(int $topic_id): string +function get_url_to_view_topic(int $_topic_id): string // Given a topic id, return a URL that can be used to view the topic. { return ""; } -function get_url_to_view_post(int $post_id): string +function get_url_to_view_post(int $_post_id): string // Given a post id, return a URL that can be used to view the post. { return ""; } // @phpstan-ignore return.unusedType -function get_url_for_user_avatar(string $username): ?string +function get_url_for_user_avatar(string $_username): ?string // Given a forum username, return a URL that can be used to load the user's // avatar. If no avatar is defined, this function returns NULL. { @@ -363,7 +363,7 @@ function get_url_to_edit_profile(): string return ""; } -function get_url_to_view_profile(int $user_id = 0): string +function get_url_to_view_profile(int $_user_id = 0): string // Return a URL that can be used to view a given user's profile. { return ""; @@ -378,13 +378,13 @@ function get_url_for_inbox(): string /** * Return the URL for searching the forums */ -function get_url_for_search(string $query): string +function get_url_for_search(string $_query): string { return ""; } // * @phpstan-ignore return.unusedType -function get_number_of_unread_messages(string $username): ?int +function get_number_of_unread_messages(string $_username): ?int // Given a forum username, return the number of unread messages. { return null; @@ -473,12 +473,12 @@ function get_topic_details(int $topic_id): ?array // ----------------------------------------------------------------------------- function topic_create( - int $forum_id, + int $_forum_id, string $post_subject, string $post_text, string $poster_name, - bool $poster_is_real, - bool $make_poster_watch_topic + bool $_poster_is_real, + bool $_make_poster_watch_topic ): ?int { $postManager = new ForumJsonPost(); $topic = $postManager->add_topic($post_subject, $post_text, $poster_name); @@ -492,7 +492,7 @@ function topic_add_post( string $post_subject, string $post_text, string $poster_name, - bool $poster_is_real + bool $_poster_is_real ): void { $postManager = new ForumJsonPost(); $postManager->add_post($topic_id, $post_subject, $post_text, $poster_name); diff --git a/pinc/forum_interface_phpbb3.inc b/pinc/forum_interface_phpbb3.inc index 9ce870973..7fabded82 100644 --- a/pinc/forum_interface_phpbb3.inc +++ b/pinc/forum_interface_phpbb3.inc @@ -144,7 +144,7 @@ function create_forum_user(string $username, string $password, string $email, bo return true; } -function phpbb_user_error_handler(int $errno, string $errstr, string $errfile, int $errline): bool +function phpbb_user_error_handler(int $errno, string $errstr, string $_errfile, int $_errline): bool { if (in_array($errno, [E_USER_ERROR, E_USER_NOTICE])) { throw new ValueError($errstr); From df56ae6b42e1cbc280ff995832e22299bde1218e Mon Sep 17 00:00:00 2001 From: Brian Foley Date: Fri, 16 Oct 2026 15:14:05 +0100 Subject: [PATCH 4/4] Prefix _ on unused func params where we want to keep the signature --- accounts/addproofer.php | 2 +- pinc/daily_page_limit.inc | 2 +- pinc/new_user_mails.inc | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/accounts/addproofer.php b/accounts/addproofer.php index 0b0ea62c6..0ebaba424 100644 --- a/accounts/addproofer.php +++ b/accounts/addproofer.php @@ -225,7 +225,7 @@ function _validate_fields( string $userpass2, string $email, string $email2, - bool $email_updates, + bool $_email_updates, string $referrer, string $referrer_details ): string { diff --git a/pinc/daily_page_limit.inc b/pinc/daily_page_limit.inc index 04b011e62..abff2f1fc 100644 --- a/pinc/daily_page_limit.inc +++ b/pinc/daily_page_limit.inc @@ -47,7 +47,7 @@ function get_dpl_count_for_user_in_round(string $username, Round $round): int * the user has done in the specified round. If the DPL is not enforced * for this user/round/project for some reason, return Null. */ -function get_dpl_enforcement_for_user(string $username, Round $round, Project $project): ?int +function get_dpl_enforcement_for_user(string $username, Round $round, Project $_project): ?int { // This function is a placeholder for sites to add any per-project // customizations that might bypass the DPL enforcement. So while it diff --git a/pinc/new_user_mails.inc b/pinc/new_user_mails.inc index 6260216bb..398470470 100644 --- a/pinc/new_user_mails.inc +++ b/pinc/new_user_mails.inc @@ -10,7 +10,7 @@ include_once($relPath.'forum_interface.inc'); // This is because this function may be called by a site admin to send // a mail to a completely different user (e.g. a Polish user shouldn't // get a Spanish mail because one of the site admins is Spanish). -function send_activate_mail(string $email, string $real_name, string $reg_token, string $username, string $u_intlang): void +function send_activate_mail(string $email, string $real_name, string $reg_token, string $username, string $_u_intlang): void { $code_url = SiteConfig::get()->code_url; $site_name = SiteConfig::get()->site_name;