From 4379b7ea77de4f8ec96b4d585f8fe5bad032fe31 Mon Sep 17 00:00:00 2001 From: HugoFara Date: Mon, 1 Apr 2024 19:01:27 +0200 Subject: [PATCH] Code doc with psalm, and manual changes. psalm configuration was also updated to remove warnings. --- do_test_test.php | 2 +- do_text_text.php | 5 +++-- edit_archivedtexts.php | 2 +- edit_languages.php | 3 ++- edit_tags.php | 2 +- edit_texttags.php | 2 +- edit_word.php | 5 +---- ggl.php | 13 ++++++------- glosbe_api.php | 2 +- inc/database_connect.php | 6 ++---- inc/session_utility.php | 24 +++++++++++++----------- inline_edit.php | 2 +- install_demo.php | 2 +- new_word.php | 2 +- print_text.php | 2 +- psalm.xml | 2 ++ set_word_on_hover.php | 2 +- settings.php | 2 +- show_word.php | 2 +- src/js/audio_controller.js | 2 +- statistics.php | 2 +- table_set_management.php | 2 +- 22 files changed, 44 insertions(+), 44 deletions(-) diff --git a/do_test_test.php b/do_test_test.php index 97b7c4b16..bbf1827b9 100644 --- a/do_test_test.php +++ b/do_test_test.php @@ -81,7 +81,7 @@ function do_test_get_identifier($selection, $sess_testsql, $lang, $text): array * * @return string SQL projection (selection) string */ -function do_test_get_test_sql($selection, $sess_testsql, $lang, $text) +function do_test_get_test_sql($selection, $sess_testsql, $lang, $text): string { $identifier = do_test_get_identifier($selection, $sess_testsql, $lang, $text); $testsql = do_test_test_get_projection($identifier[0], $identifier[1]); diff --git a/do_text_text.php b/do_text_text.php index cb145b4a8..bb2d9a814 100644 --- a/do_text_text.php +++ b/do_text_text.php @@ -851,8 +851,9 @@ function do_text_text_content($textid, $only_body = true): void } /* - * Uncoment to use as a page, deprecated behavior in LWT-fork, will be removed in 3.0.0 -if (isset($_REQUEST['text'])) { +Uncoment to use as a page, deprecated behavior in LWT-fork, will be removed in 3.0.0 + + if (isset($_REQUEST['text'])) { do_text_text_content($_REQUEST['text'], false); } */ diff --git a/edit_archivedtexts.php b/edit_archivedtexts.php index 88f776c6b..8ba4b2e5f 100644 --- a/edit_archivedtexts.php +++ b/edit_archivedtexts.php @@ -1,6 +1,6 @@

Third-Party Voice API

diff --git a/edit_tags.php b/edit_tags.php index ce0b59ffc..c9f9fbba3 100644 --- a/edit_tags.php +++ b/edit_tags.php @@ -1,6 +1,6 @@ , list{0?: string,...}} + * @psalm-return list{0?: array{SeID: int, TxID: int, position: int, term: string},...} */ function findMecabExpression($text, $lid): array { @@ -2935,9 +2935,11 @@ function insertExpressionFromMeCab($textlc, $lid, $wid, $len, $mode): array * @param string $textlc Text to insert in lower case * @param string|int $lid Language ID * - * @return (string|int)[] Each inserted mutli-word details + * @return (int|null|string)[][] Each inserted mutli-word details * * @global string $tbpref Table name prefix + * + * @psalm-return list{0?: array{SeID: int, SeTxID: int, position: int, term: null|string, term_display: null|string},...} */ function findStandardExpression($textlc, $lid): array { @@ -3587,12 +3589,12 @@ function create_save_ann($textid): string /** * Truncate the database, remove all data belonging by the current user. - * + * * Keep settings. - * + * * @global $tbpref */ -function truncateUserDatabase() +function truncateUserDatabase(): void { global $tbpref; runsql("TRUNCATE {$tbpref}archivedtexts", ''); diff --git a/inline_edit.php b/inline_edit.php index c0bc9077e..5baf49f59 100644 --- a/inline_edit.php +++ b/inline_edit.php @@ -1,6 +1,6 @@