fix or ignore phpstan 0.12.63 errors
Signed-off-by: William Desportes <williamdes@wdes.fr>
This commit is contained in:
parent
fb5d6159af
commit
b4f1e14e80
@ -84,7 +84,7 @@
|
||||
"php-webdriver/webdriver": "^1.8",
|
||||
"phpmyadmin/coding-standard": "^2.1.1",
|
||||
"phpstan/extension-installer": "^1.1",
|
||||
"phpstan/phpstan": "^0.12.61",
|
||||
"phpstan/phpstan": "^0.12.63",
|
||||
"phpstan/phpstan-phpunit": "^0.12.17",
|
||||
"phpunit/phpunit": "^7.5 || ^8.0 || ^9.0",
|
||||
"pragmarx/google2fa-qrcode": "^1.0.1",
|
||||
|
||||
@ -209,7 +209,9 @@ class AuthenticationSignon extends AuthenticationPlugin
|
||||
/* Restart phpMyAdmin session */
|
||||
if (! defined('TESTSUITE')) {
|
||||
$this->setCookieParams($oldCookieParams);
|
||||
session_name($old_session);
|
||||
if ($old_session !== null) {
|
||||
session_name($old_session);
|
||||
}
|
||||
if (! empty($old_id)) {
|
||||
session_id($old_id);
|
||||
}
|
||||
|
||||
@ -816,7 +816,6 @@ class Util
|
||||
$ret = strftime($date, (int) $timestamp);
|
||||
// Some OSes such as Win8.1 Traditional Chinese version did not produce UTF-8
|
||||
// output here. See https://github.com/phpmyadmin/phpmyadmin/issues/10598
|
||||
/** @phpstan-ignore-next-line */
|
||||
if ($ret === false
|
||||
|| mb_detect_encoding($ret, 'UTF-8', true) !== 'UTF-8'
|
||||
) {
|
||||
|
||||
@ -86,12 +86,12 @@ class FormatConverter
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public static function longToIp($buffer)
|
||||
public static function longToIp($buffer): string
|
||||
{
|
||||
if (! Util::isInteger($buffer) || $buffer < 0 || $buffer > 4294967295) {
|
||||
return $buffer;
|
||||
}
|
||||
|
||||
return long2ip((int) $buffer);
|
||||
return (string) long2ip((int) $buffer);
|
||||
}
|
||||
}
|
||||
|
||||
@ -400,11 +400,36 @@ parameters:
|
||||
count: 1
|
||||
path: libraries/classes/DatabaseInterface.php
|
||||
|
||||
-
|
||||
message: "#^Cannot call method ssl_set\\(\\) on mysqli\\|false\\.$#"
|
||||
count: 1
|
||||
path: libraries/classes/Dbal/DbiMysqli.php
|
||||
|
||||
-
|
||||
message: "#^Cannot call method options\\(\\) on mysqli\\|false\\.$#"
|
||||
count: 3
|
||||
path: libraries/classes/Dbal/DbiMysqli.php
|
||||
|
||||
-
|
||||
message: "#^Cannot call method real_connect\\(\\) on mysqli\\|false\\.$#"
|
||||
count: 1
|
||||
path: libraries/classes/Dbal/DbiMysqli.php
|
||||
|
||||
-
|
||||
message: "#^Strict comparison using \\=\\=\\= between true and null will always evaluate to false\\.$#"
|
||||
count: 1
|
||||
path: libraries/classes/Dbal/DbiMysqli.php
|
||||
|
||||
-
|
||||
message: "#^Cannot access property \\$connect_errno on mysqli\\|false\\.$#"
|
||||
count: 1
|
||||
path: libraries/classes/Dbal/DbiMysqli.php
|
||||
|
||||
-
|
||||
message: "#^Cannot access property \\$connect_error on mysqli\\|false\\.$#"
|
||||
count: 1
|
||||
path: libraries/classes/Dbal/DbiMysqli.php
|
||||
|
||||
-
|
||||
message: "#^Unreachable statement \\- code above always terminates\\.$#"
|
||||
count: 2
|
||||
@ -645,6 +670,11 @@ parameters:
|
||||
count: 1
|
||||
path: libraries/classes/File.php
|
||||
|
||||
-
|
||||
message: "#^Method PhpMyAdmin\\\\File\\:\\:read\\(\\) should return string but returns string\\|false\\.$#"
|
||||
count: 3
|
||||
path: libraries/classes/File.php
|
||||
|
||||
-
|
||||
message: "#^Parameter \\#1 \\$bz of function bzread expects resource, resource\\|null given\\.$#"
|
||||
count: 1
|
||||
@ -655,11 +685,6 @@ parameters:
|
||||
count: 1
|
||||
path: libraries/classes/File.php
|
||||
|
||||
-
|
||||
message: "#^Method PhpMyAdmin\\\\File\\:\\:read\\(\\) should return string but returns string\\|false\\.$#"
|
||||
count: 1
|
||||
path: libraries/classes/File.php
|
||||
|
||||
-
|
||||
message: "#^Parameter \\#1 \\$fp of function fread expects resource, resource\\|null given\\.$#"
|
||||
count: 1
|
||||
@ -1025,6 +1050,16 @@ parameters:
|
||||
count: 1
|
||||
path: libraries/classes/Language.php
|
||||
|
||||
-
|
||||
message: "#^Property PhpMyAdmin\\\\LanguageManager\\:\\:\\$availableLocales \\(array\\) does not accept array\\|false\\.$#"
|
||||
count: 1
|
||||
path: libraries/classes/LanguageManager.php
|
||||
|
||||
-
|
||||
message: "#^Method PhpMyAdmin\\\\LanguageManager\\:\\:availableLocales\\(\\) should return array but returns array\\|false\\.$#"
|
||||
count: 1
|
||||
path: libraries/classes/LanguageManager.php
|
||||
|
||||
-
|
||||
message: "#^Right side of && is always true\\.$#"
|
||||
count: 1
|
||||
@ -1110,6 +1145,11 @@ parameters:
|
||||
count: 1
|
||||
path: libraries/classes/Plugins/Auth/AuthenticationHttp.php
|
||||
|
||||
-
|
||||
message: "#^Parameter \\#1 \\$newname of function session_name expects string, string\\|false given\\.$#"
|
||||
count: 1
|
||||
path: libraries/classes/Plugins/Auth/AuthenticationSignon.php
|
||||
|
||||
-
|
||||
message: "#^Strict comparison using \\=\\=\\= between mixed and null will always evaluate to false\\.$#"
|
||||
count: 1
|
||||
@ -1205,6 +1245,11 @@ parameters:
|
||||
count: 1
|
||||
path: libraries/classes/Plugins/Import/ImportCsv.php
|
||||
|
||||
-
|
||||
message: "#^Parameter \\#1 \\$var of function count expects array\\|Countable, array\\|false given\\.$#"
|
||||
count: 2
|
||||
path: libraries/classes/Plugins/Import/ImportCsv.php
|
||||
|
||||
-
|
||||
message: "#^Argument of an invalid type array\\<int, string\\>\\|false supplied for foreach, only iterables are supported\\.$#"
|
||||
count: 1
|
||||
|
||||
@ -45,13 +45,13 @@ class HttpRequestTest extends AbstractTestCase
|
||||
* and CURLOPT_CAINFO flags, see
|
||||
* https://curl.haxx.se/docs/ssl-compared.html
|
||||
*/
|
||||
if (stripos($curl['ssl_version'], 'WinSSL') === false
|
||||
if ($curl !== false && stripos($curl['ssl_version'], 'WinSSL') === false
|
||||
&& stripos($curl['ssl_version'], 'SecureTransport') === false
|
||||
) {
|
||||
return;
|
||||
}
|
||||
|
||||
$this->markTestSkipped('Not supported in CURL SSL backend: ' . $curl['ssl_version']);
|
||||
$this->markTestSkipped('Not supported in CURL SSL backend: ' . ($curl !== false ? $curl['ssl_version'] : '?'));
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Loading…
Reference in New Issue
Block a user