From 7b84c825e0fd0c2fe1a6e0816249b3a504976806 Mon Sep 17 00:00:00 2001
From: Brian Foley
"; echo sprintf(_('Before you can begin proofreading, you must have:')); echo "
"; echo sprintf(_('Before you can begin proofreading, you must have:')); echo "
" . _("View all Special Days") . "
"; diff --git a/pinc/upload_file.inc b/pinc/upload_file.inc index 0a893e6e9..ad36137ae 100644 --- a/pinc/upload_file.inc +++ b/pinc/upload_file.inc @@ -109,7 +109,7 @@ function show_upload_form(string $form_content, string $submit_label): void", get_big_upload_blurb(), "
", _("File to upload"), ": ", - "", sprintf(_("After you click the '%s' button, the browser will appear to be slow getting to the next page. This is because it is uploading the file."), $submit_label), "
", + "", $submit_blurb, "
", ""; // if resumable, these are shown instead diff --git a/pinc/user_project_info.inc b/pinc/user_project_info.inc index f5e46fed2..9ceda2b40 100644 --- a/pinc/user_project_info.inc +++ b/pinc/user_project_info.inc @@ -157,8 +157,7 @@ function set_user_project_event_subscription(string $username, string $projectid { assert($bit === 0 || $bit === 1); - $event_label = get_label_for_event($event); - // Just to ensure that $event is valid; we don't use $event_label. + get_label_for_event($event); // Just to ensure that $event is valid // Now that we're sure the row exists, we can update it. $sql = sprintf( @@ -176,13 +175,12 @@ function set_user_project_event_subscription(string $username, string $projectid $bit, $bit ); - $res = DPDatabase::query($sql); + DPDatabase::query($sql); } function user_is_subscribed_to_project_event(string $username, string $projectid, string $event): bool { - $event_label = get_label_for_event($event); - // Just to ensure that $event is valid; we don't use $event_label. + get_label_for_event($event); // Just to ensure that $event is valid $sql = sprintf( " @@ -315,7 +313,7 @@ function notify_project_event_subscribers(Project $project, string $event, array $n_subscribers, DPDatabase::escape($projectid) ); - $res4 = DPDatabase::query($sql4); + DPDatabase::query($sql4); } } diff --git a/pinc/wordcheck_engine.inc b/pinc/wordcheck_engine.inc index 40b1e029e..62ca77186 100644 --- a/pinc/wordcheck_engine.inc +++ b/pinc/wordcheck_engine.inc @@ -469,7 +469,7 @@ function get_bad_words_with_diacritical_markup($input_words_w_freq): array */ function get_bad_words_via_pattern($input_words_w_freq, $languages) { - [$langcode3s, $messages] = get_langcode3s_for_languages($languages); + [$langcode3s, $_messages] = get_langcode3s_for_languages($languages); $badWords = []; @@ -816,9 +816,7 @@ function load_project_good_word_suggestions(string $projectid, int $start_time = return $wordsArray; } - foreach ($eventArray as $event) { - [$time, $round, $page, $proofer, $words] = $event; - + foreach ($eventArray as [$_time, $round, $page, $_proofer, $words]) { if (count($words)) { if (!isset($wordsArray[$round][$page])) { $wordsArray[$round][$page] = []; @@ -836,7 +834,7 @@ function load_project_good_word_suggestions(string $projectid, int $start_time = function load_site_good_words_given_project(string $projectid): array { $languages = get_project_languages($projectid); - [$langcode3s, $messages] = get_langcode3s_for_languages($languages); + [$langcode3s, $_messages] = get_langcode3s_for_languages($languages); return load_site_good_words($langcode3s); } @@ -844,7 +842,7 @@ function load_site_good_words_given_project(string $projectid): array function load_site_bad_words_given_project(string $projectid): array { $languages = get_project_languages($projectid); - [$langcode3s, $messages] = get_langcode3s_for_languages($languages); + [$langcode3s, $_messages] = get_langcode3s_for_languages($languages); return load_site_bad_words($langcode3s); } @@ -852,7 +850,7 @@ function load_site_bad_words_given_project(string $projectid): array function load_site_possible_bad_words_given_project(string $projectid): array { $languages = get_project_languages($projectid); - [$langcode3s, $messages] = get_langcode3s_for_languages($languages); + [$langcode3s, $_messages] = get_langcode3s_for_languages($languages); return load_site_possible_bad_words($langcode3s); } @@ -1274,7 +1272,6 @@ function get_all_words_in_text(string $text, bool $with_offsets = false) if ($with_offsets) { $result = []; foreach ($matches[0] as [$word, $offset_bytes]) { - $search_offset = 0; // offsets from preg_match_all() are in bytes, but we need the // offset in characters $offset = UTF8::strlen(substr($text, 0, $offset_bytes)); diff --git a/project.php b/project.php index 0b2575a0f..fe68bf7f9 100644 --- a/project.php +++ b/project.php @@ -2050,7 +2050,6 @@ function do_change_state(): void function do_page_summary(): void { global $project; - $projectid = $project->projectid; if (!$project->pages_table_exists) { return; diff --git a/stats/misc_stats1.php b/stats/misc_stats1.php index 6f481f627..2f20a07ac 100644 --- a/stats/misc_stats1.php +++ b/stats/misc_stats1.php @@ -96,7 +96,6 @@ function show_top_days(int $limit, string $when): void switch ($when) { case 'ever': - $where = ''; $sub_title = sprintf(_('Top %d Proofreading Days Ever'), $limit); break; diff --git a/tasks.php b/tasks.php index c044da2c2..250b73658 100644 --- a/tasks.php +++ b/tasks.php @@ -1643,7 +1643,7 @@ function insert_related_task(int $task1, int $task2): void $task_id_1, $task_id_2 ); - $result = DPDatabase::query($sql); + DPDatabase::query($sql); } function remove_related_task(int $task1, int $task2): void @@ -1661,7 +1661,7 @@ function remove_related_task(int $task1, int $task2): void $task_id_1, $task_id_2 ); - $result = DPDatabase::query($sql); + DPDatabase::query($sql); } function RelatedPostings(int $tid): void diff --git a/tools/project_manager/add_files.php b/tools/project_manager/add_files.php index f08890729..0bf9c3af4 100644 --- a/tools/project_manager/add_files.php +++ b/tools/project_manager/add_files.php @@ -536,7 +536,7 @@ public function _check_file(string $filename): string $ALLOWED_EXTENSIONS = ['.txt', '.png', '.jpg']; - [$base, $ext] = split_filename($filename); + [$_base, $ext] = split_filename($filename); if (!in_array($ext, $ALLOWED_EXTENSIONS)) { return _('filename has unrecognized suffix'); } diff --git a/tools/project_manager/bad_bytes_explainer.php b/tools/project_manager/bad_bytes_explainer.php index b6193d502..7efa0d362 100644 --- a/tools/project_manager/bad_bytes_explainer.php +++ b/tools/project_manager/bad_bytes_explainer.php @@ -159,8 +159,7 @@ function show_a_table_of_bads(string $desired_badness): void "; global $_bad_byte_sequences; - foreach ($_bad_byte_sequences as $raw => $remarks) { - [$code_point, $why_bad] = $remarks; + foreach ($_bad_byte_sequences as $raw => [$_code_point, $why_bad]) { if (str_starts_with($desired_badness, '/')) { $matches = preg_match($desired_badness, $why_bad); } else { diff --git a/tools/project_manager/editproject.php b/tools/project_manager/editproject.php index 4e6e8007c..6bb4283fd 100644 --- a/tools/project_manager/editproject.php +++ b/tools/project_manager/editproject.php @@ -480,7 +480,6 @@ public function show_visible_controls(): void $can_set_difficulty_tofrom_beginner = ($pguser == "BEGIN") || user_is_a_sitemanager(); $can_edit_PPer = true; - $is_checked_out = false; if (!empty($this->project->projectid)) { $this->row(_("Project ID"), html_safe($this->project->projectid)); @@ -490,12 +489,10 @@ public function show_visible_controls(): void } elseif ($this->project->state == PROJ_POST_FIRST_CHECKED_OUT) { // once the project is in PP, PPer can only be changed by an SA, PF, // or if it's checked out to the PM - $is_checked_out = true; $can_edit_PPer = (($this->project->username == $this->project->checkedoutby) || user_is_a_sitemanager() || user_is_proj_facilitator()); } elseif ($this->project->state == PROJ_POST_SECOND_CHECKED_OUT) { - $is_checked_out = true; $can_edit_PPer = user_is_a_sitemanager(); } } diff --git a/tools/project_manager/handle_bad_page.php b/tools/project_manager/handle_bad_page.php index 9f39146d5..ff935bf8a 100644 --- a/tools/project_manager/handle_bad_page.php +++ b/tools/project_manager/handle_bad_page.php @@ -305,7 +305,6 @@ function update_image(string $projectid, string $image): void global $projects_dir; $org_image_ext = substr($image, -4); - $org_image_basename = basename($image, $org_image_ext); $tmp_image_ext = substr($_FILES['image_upload']['name'], -4); if ($tmp_image_ext == ".png" || $tmp_image_ext == ".jpg") { diff --git a/tools/project_manager/show_current_flagged_words.php b/tools/project_manager/show_current_flagged_words.php index 4054498d2..8b8f17a81 100644 --- a/tools/project_manager/show_current_flagged_words.php +++ b/tools/project_manager/show_current_flagged_words.php @@ -146,7 +146,7 @@ function _get_current_flagged_word_list(string $projectid): array $page_texts = get_page_texts($pages_res); // now run it through WordCheck - [$bad_words_w_freq, $languages, $messages] = + [$bad_words_w_freq, $_languages, $messages] = get_bad_word_freqs_for_project_text($page_texts, $projectid, get_project_languages($projectid)); // multisort screws up all-numeric words so we need to preprocess first diff --git a/tools/project_manager/show_project_stealth_scannos.php b/tools/project_manager/show_project_stealth_scannos.php index 44b0e0dac..f79b28c4e 100644 --- a/tools/project_manager/show_project_stealth_scannos.php +++ b/tools/project_manager/show_project_stealth_scannos.php @@ -308,7 +308,7 @@ function _get_stealth_scanno_word_list(string $projectid): array $text_to_check = implode(" ", $possible_scannos); // run the list through WordCheck to see which it would flag - [$possible_scannos_via_wordcheck, $languages, $messages] = + [$possible_scannos_via_wordcheck, $_languages, $messages] = get_bad_word_freqs_for_project_text($text_to_check, $projectid, get_project_languages($projectid)); // load site words diff --git a/tools/proofers/my_suggestions.php b/tools/proofers/my_suggestions.php index 217462c3c..c433bdcfd 100644 --- a/tools/proofers/my_suggestions.php +++ b/tools/proofers/my_suggestions.php @@ -222,10 +222,6 @@ function show_headings(array $colspecs, string $username): void $class = sprintf("class='%s'", $colspec['class']); } echo "