1
0
mirror of https://github.com/vrana/adminer.git synced 2025-08-16 11:34:10 +02:00

PHPStan: Fix level 4 errors

This commit is contained in:
Jakub Vrana
2025-03-26 18:32:45 +01:00
parent 53d5e7b60a
commit c78299a3f6
7 changed files with 73 additions and 51 deletions

View File

@@ -61,6 +61,7 @@ function check_invalid_login() {
break;
}
}
/** @var array{int, int} */
$invalid = idx($invalids, $adminer->bruteForceKey(), array());
$next_attempt = ($invalid[1] > 29 ? $invalid[0] - time() : 0); // allow 30 invalid attempts
if ($next_attempt > 0) { //! do the same with permanent login

View File

@@ -124,7 +124,7 @@ function referencable_primary($self) {
/** Print SQL <textarea> tag
* @param string
* @param string or array in which case [0] of every element is used
* @param string|list<array{string}>
* @param int
* @param int
* @return void

View File

@@ -174,7 +174,7 @@ function sid() {
* @param string
* @param string
* @param string
* @param string
* @param ?string
* @return void
*/
function set_password($vendor, $server, $username, $password) {
@@ -185,7 +185,7 @@ function set_password($vendor, $server, $username, $password) {
}
/** Get password from session
* @return string or null for missing password or false for expired password
* @return string|false|null null for missing password, false for expired password
*/
function get_password() {
$return = get_session("pwds");
@@ -549,7 +549,7 @@ class Queries {
/** Execute and remember query
* @param string end with ';' to use DELIMITER
* @return Result
* @return Result|bool
*/
function queries($query) {
global $connection;
@@ -902,7 +902,7 @@ function rand_string() {
}
/** Format value to use in select
* @param string
* @param string|string[]
* @param string
* @param Field
* @param int
@@ -945,7 +945,7 @@ function select_value($val, $link, $field, $text_length) {
}
/** Check whether the string is e-mail address
* @param string
* @param ?string
* @return bool
*/
function is_mail($email) {