From 31bdc9067bc51b4fdc4030b52de5c867c338b849 Mon Sep 17 00:00:00 2001 From: Kamil Tekiela Date: Mon, 13 Feb 2023 21:04:06 +0000 Subject: [PATCH 1/2] array_combine does not return false anymore Signed-off-by: Kamil Tekiela --- libraries/classes/ZipExtension.php | 1 - phpstan-baseline.neon | 5 ----- psalm-baseline.xml | 3 --- 3 files changed, 9 deletions(-) diff --git a/libraries/classes/ZipExtension.php b/libraries/classes/ZipExtension.php index 0e6866695b..ce1e66e189 100644 --- a/libraries/classes/ZipExtension.php +++ b/libraries/classes/ZipExtension.php @@ -236,7 +236,6 @@ class ZipExtension $data = $newData; } elseif (is_array($data) && is_array($name) && count($data) === count($name)) { - /** @var array $data */ $data = array_combine($name, $data); } else { return false; diff --git a/phpstan-baseline.neon b/phpstan-baseline.neon index e1923b1e4d..10fac3e808 100644 --- a/phpstan-baseline.neon +++ b/phpstan-baseline.neon @@ -9190,11 +9190,6 @@ parameters: count: 1 path: libraries/classes/ZipExtension.php - - - message: "#^PHPDoc tag @var for variable \\$data has no value type specified in iterable type array\\.$#" - count: 1 - path: libraries/classes/ZipExtension.php - - message: "#^Call to function method_exists\\(\\) with 'PHPUnit\\\\\\\\Framework\\\\\\\\TestCase' and 'assertFileDoesNotEx…' will always evaluate to true\\.$#" count: 1 diff --git a/psalm-baseline.xml b/psalm-baseline.xml index cb75d827e5..c244095d66 100644 --- a/psalm-baseline.xml +++ b/psalm-baseline.xml @@ -16304,9 +16304,6 @@ (string) substr($zdata, 0, strlen($zdata) - 4) - - array - From 5c5eeb93467cbff3f0140bb0f6d1ad3b22c5c8fe Mon Sep 17 00:00:00 2001 From: Kamil Tekiela Date: Mon, 13 Feb 2023 20:49:55 +0000 Subject: [PATCH 2/2] substr() now returns an empty string Signed-off-by: Kamil Tekiela --- libraries/classes/InsertEdit.php | 2 +- libraries/classes/ZipExtension.php | 2 +- phpstan-baseline.neon | 15 --------------- psalm-baseline.xml | 11 +---------- 4 files changed, 3 insertions(+), 27 deletions(-) diff --git a/libraries/classes/InsertEdit.php b/libraries/classes/InsertEdit.php index 481cf9b250..c9a8d9bdf1 100644 --- a/libraries/classes/InsertEdit.php +++ b/libraries/classes/InsertEdit.php @@ -1132,7 +1132,7 @@ class InsertEdit $specialChars = bin2hex($column['Default']); } elseif (substr($trueType, -4) === 'text') { $textDefault = substr($column['Default'], 1, -1); - $specialChars = stripcslashes($textDefault !== false ? $textDefault : $column['Default']); + $specialChars = stripcslashes($textDefault !== '' ? $textDefault : $column['Default']); } else { $specialChars = htmlspecialchars($column['Default']); } diff --git a/libraries/classes/ZipExtension.php b/libraries/classes/ZipExtension.php index ce1e66e189..6ea97e306c 100644 --- a/libraries/classes/ZipExtension.php +++ b/libraries/classes/ZipExtension.php @@ -268,7 +268,7 @@ class ZipExtension $uncLen = strlen($dump); $crc = crc32($dump); $zdata = (string) gzcompress($dump); - $zdata = substr((string) substr($zdata, 0, strlen($zdata) - 4), 2); // fix crc bug + $zdata = substr(substr($zdata, 0, strlen($zdata) - 4), 2); // fix crc bug $cLen = strlen($zdata); $fr = "\x50\x4b\x03\x04" . "\x14\x00" // ver needed to extract diff --git a/phpstan-baseline.neon b/phpstan-baseline.neon index 10fac3e808..26381b8e06 100644 --- a/phpstan-baseline.neon +++ b/phpstan-baseline.neon @@ -4895,11 +4895,6 @@ parameters: count: 1 path: libraries/classes/IndexColumn.php - - - message: "#^Else branch is unreachable because ternary operator condition is always true\\.$#" - count: 1 - path: libraries/classes/InsertEdit.php - - message: "#^Method PhpMyAdmin\\\\InsertEdit\\:\\:analyzeTableColumnsArray\\(\\) has parameter \\$column with no value type specified in iterable type array\\.$#" count: 1 @@ -5245,11 +5240,6 @@ parameters: count: 1 path: libraries/classes/InsertEdit.php - - - message: "#^Strict comparison using \\!\\=\\= between string and false will always evaluate to true\\.$#" - count: 1 - path: libraries/classes/InsertEdit.php - - message: "#^Method PhpMyAdmin\\\\InternalRelations\\:\\:getInformationSchema\\(\\) return type has no value type specified in iterable type array\\.$#" count: 1 @@ -9165,11 +9155,6 @@ parameters: count: 1 path: libraries/classes/VersionInformation.php - - - message: "#^Casting to string something that's already string\\.$#" - count: 1 - path: libraries/classes/ZipExtension.php - - message: "#^Method PhpMyAdmin\\\\ZipExtension\\:\\:createFile\\(\\) has parameter \\$data with no value type specified in iterable type array\\.$#" count: 1 diff --git a/psalm-baseline.xml b/psalm-baseline.xml index c244095d66..95a1619312 100644 --- a/psalm-baseline.xml +++ b/psalm-baseline.xml @@ -9271,9 +9271,6 @@ - - $column['Default'] - $urlParams @@ -9364,7 +9361,7 @@ $specialChars $specialChars $specialCharsEncoded - $textDefault !== false ? $textDefault : $column['Default'] + $textDefault !== '' ? $textDefault : $column['Default'] $transformationPlugin->getScripts() $transformation[$type . '_options'] ?? '' $trueType @@ -9515,9 +9512,6 @@ (int) $GLOBALS['cfg']['InsertRows'] - - $textDefault !== false - @@ -16301,9 +16295,6 @@ $time - - (string) substr($zdata, 0, strlen($zdata) - 4) -