From 3de9b231569c9e286364b5e14152b7f33301632f Mon Sep 17 00:00:00 2001 From: Jakub Vrana Date: Wed, 26 Mar 2025 13:09:49 +0100 Subject: [PATCH] PHPStan: Use @return void PHPStan then warns abouts using the return value --- adminer/include/adminer.inc.php | 42 +++++++++++++++---------------- adminer/include/design.inc.php | 8 +++--- adminer/include/driver.inc.php | 2 +- adminer/include/editing.inc.php | 14 +++++------ adminer/include/functions.inc.php | 16 ++++++------ adminer/include/html.inc.php | 12 ++++----- 6 files changed, 47 insertions(+), 47 deletions(-) diff --git a/adminer/include/adminer.inc.php b/adminer/include/adminer.inc.php index 0a3a9b23..b4ccb81a 100644 --- a/adminer/include/adminer.inc.php +++ b/adminer/include/adminer.inc.php @@ -81,7 +81,7 @@ class Adminer { } /** Headers to send before HTML output - * @return null + * @return void */ function headers() { } @@ -119,7 +119,7 @@ class Adminer { } /** Print login form - * @return null + * @return void */ function loginForm() { global $drivers; @@ -180,7 +180,7 @@ class Adminer { /** Print links after select heading * @param TableStatus result of table_status1() * @param string new item options, NULL for no new item - * @return null + * @return void */ function selectLinks($tableStatus, $set = "") { global $driver; @@ -230,7 +230,7 @@ class Adminer { /** Print backward keys for row * @param BackwardKey[] result of $this->backwardKeys() * @param string[] - * @return null + * @return void */ function backwardKeysPrint($backwardKeys, $row) { } @@ -325,7 +325,7 @@ class Adminer { /** Print table structure in tabular format * @param Field[] data about individual fields * @param TableStatus - * @return null + * @return void */ function tableStructurePrint($fields, $tableStatus = null) { global $driver; @@ -356,7 +356,7 @@ class Adminer { /** Print list of indexes on table in tabular format * @param Index[] data about all indexes on a table - * @return null + * @return void */ function tableIndexesPrint($indexes) { echo "\n"; @@ -377,7 +377,7 @@ class Adminer { /** Print columns box in select * @param list result of selectColumnsProcess()[0] * @param string[] selectable columns - * @return null + * @return void */ function selectColumnsPrint($select, $columns) { global $driver; @@ -405,7 +405,7 @@ class Adminer { * @param list result of selectSearchProcess() * @param string[] selectable columns * @param Index[] - * @return null + * @return void */ function selectSearchPrint($where, $columns, $indexes) { print_fieldset("search", lang('Search'), $where); @@ -441,7 +441,7 @@ class Adminer { * @param list result of selectOrderProcess() * @param string[] selectable columns * @param Index[] - * @return null + * @return void */ function selectOrderPrint($order, $columns, $indexes) { print_fieldset("sort", lang('Sort'), $order); @@ -460,7 +460,7 @@ class Adminer { /** Print limit box in select * @param string result of selectLimitProcess() - * @return null + * @return void */ function selectLimitPrint($limit) { echo "
" . lang('Limit') . "
"; //
for easy styling @@ -471,7 +471,7 @@ class Adminer { /** Print text length box in select * @param string result of selectLengthProcess() - * @return null + * @return void */ function selectLengthPrint($text_length) { if ($text_length !== null) { @@ -483,7 +483,7 @@ class Adminer { /** Print action box in select * @param Index[] - * @return null + * @return void */ function selectActionPrint($indexes) { echo "
" . lang('Action') . "
"; @@ -525,7 +525,7 @@ class Adminer { /** Print extra text in the end of a select form * @param string[] fields holding e-mails * @param string[] selectable columns - * @return null + * @return void */ function selectEmailPrint($emailFields, $columns) { } @@ -693,7 +693,7 @@ class Adminer { * @param array[] * @param mixed * @param bool - * @return null + * @return void */ function editRowPrint($table, $fields, $row, $update) { } @@ -799,7 +799,7 @@ class Adminer { /** Export database structure * @param string - * @return null prints data + * @return void prints data */ function dumpDatabase($db) { } @@ -808,7 +808,7 @@ class Adminer { * @param string * @param string * @param int 0 table, 1 view, 2 temporary view table - * @return null prints data + * @return void prints data */ function dumpTable($table, $style, $is_view = 0) { if ($_POST["format"] != "sql") { @@ -843,7 +843,7 @@ class Adminer { * @param string * @param string * @param string - * @return null prints data + * @return void prints data */ function dumpData($table, $style, $query) { global $connection; @@ -964,7 +964,7 @@ class Adminer { } /** Print text after export - * @return null prints data + * @return void prints data */ function dumpFooter() { if ($_POST["format"] == "sql") { @@ -992,7 +992,7 @@ class Adminer { /** Print navigation after Adminer title * @param string can be "auth" if there is no database connection, "db" if there is no database selected, "ns" with invalid schema - * @return null + * @return void */ function navigation($missing) { global $VERSION, $drivers, $connection; @@ -1083,7 +1083,7 @@ class Adminer { /** Print databases list in menu * @param string - * @return null + * @return void */ function databasesPrint($missing) { global $adminer, $connection; @@ -1118,7 +1118,7 @@ class Adminer { /** Print table list in menu * @param TableStatus[] result of table_status('', true) - * @return null + * @return void */ function tablesPrint($tables) { echo "
    " . script("mixin(qs('#tables'), {onmouseover: menuOver, onmouseout: menuOut});"); diff --git a/adminer/include/design.inc.php b/adminer/include/design.inc.php index de33995e..09cad415 100644 --- a/adminer/include/design.inc.php +++ b/adminer/include/design.inc.php @@ -6,7 +6,7 @@ namespace Adminer; * @param string * @param mixed ["key" => "link", "key2" => ["link", "desc"]], null for nothing, false for driver only, true for driver and server * @param string used after colon in title and heading, should be HTML escaped -* @return null +* @return void */ function page_header($title, $error = "", $breadcrumb = array(), $title2 = "") { global $LANG, $VERSION, $adminer, $drivers; @@ -128,7 +128,7 @@ const thousandsSeparator = '" . js_escape(lang(',')) . "';") } /** Send HTTP headers -* @return null +* @return void */ function page_headers() { global $adminer; @@ -177,7 +177,7 @@ function get_nonce() { /** Print flash and error messages * @param string -* @return null +* @return void */ function page_messages($error) { global $adminer; @@ -197,7 +197,7 @@ function page_messages($error) { /** Print HTML footer * @param string "auth", "db", "ns" -* @return null +* @return void */ function page_footer($missing = "") { global $adminer; diff --git a/adminer/include/driver.inc.php b/adminer/include/driver.inc.php index b7f5f3bb..a9af6ab0 100644 --- a/adminer/include/driver.inc.php +++ b/adminer/include/driver.inc.php @@ -6,7 +6,7 @@ $drivers = array(); /** Add a driver * @param string * @param string -* @return null +* @return void */ function add_driver($id, $name) { global $drivers; diff --git a/adminer/include/editing.inc.php b/adminer/include/editing.inc.php index 005db513..ebb5f89b 100644 --- a/adminer/include/editing.inc.php +++ b/adminer/include/editing.inc.php @@ -127,7 +127,7 @@ function referencable_primary($self) { * @param string or array in which case [0] of every element is used * @param int * @param int -* @return null +* @return void */ function textarea($name, $value, $rows = 10, $cols = 80) { echo "