diff --git a/libraries/classes/InsertEdit.php b/libraries/classes/InsertEdit.php index 561107db6b..8b4906bd3a 100644 --- a/libraries/classes/InsertEdit.php +++ b/libraries/classes/InsertEdit.php @@ -811,6 +811,7 @@ class InsertEdit * * @return mixed[] $real_null_value, $data, $special_chars, $backup_field, * $special_chars_encoded + * @psalm-return array{bool, string, string, string, string} */ private function getSpecialCharsAndBackupFieldForExistingRow( array $currentRow, @@ -1998,7 +1999,7 @@ class InsertEdit $isColumnProtectedBlob = ($GLOBALS['cfg']['ProtectBinary'] === 'blob' && $column['is_blob']) || ($GLOBALS['cfg']['ProtectBinary'] === 'all') || ($GLOBALS['cfg']['ProtectBinary'] === 'noblob' && ! $column['is_blob']); - if ($isColumnProtectedBlob && isset($data)) { + if ($isColumnProtectedBlob) { $blobSize = Util::formatByteDown(mb_strlen(stripslashes($data)), 3, 1); if ($blobSize !== null) { [$blobValue, $blobValueUnit] = $blobSize; diff --git a/phpstan-baseline.neon b/phpstan-baseline.neon index 284dd39b02..da7dcd7db1 100644 --- a/phpstan-baseline.neon +++ b/phpstan-baseline.neon @@ -4815,11 +4815,6 @@ parameters: count: 1 path: libraries/classes/InsertEdit.php - - - message: "#^Parameter \\#1 \\$string of function stripslashes expects string, mixed given\\.$#" - count: 1 - path: libraries/classes/InsertEdit.php - - message: "#^Parameter \\#1 \\$string of function substr expects string, mixed given\\.$#" count: 1 @@ -4850,16 +4845,6 @@ parameters: count: 1 path: libraries/classes/InsertEdit.php - - - message: "#^Parameter \\#11 \\$specialCharsEncoded of method PhpMyAdmin\\\\InsertEdit\\:\\:getValueColumnForOtherDatatypes\\(\\) expects string, mixed given\\.$#" - count: 1 - path: libraries/classes/InsertEdit.php - - - - message: "#^Parameter \\#12 \\$data of method PhpMyAdmin\\\\InsertEdit\\:\\:getValueColumnForOtherDatatypes\\(\\) expects string, mixed given\\.$#" - count: 1 - path: libraries/classes/InsertEdit.php - - message: "#^Parameter \\#2 \\$column of method PhpMyAdmin\\\\ConfigStorage\\\\Relation\\:\\:searchColumnInForeigners\\(\\) expects string, mixed given\\.$#" count: 1 @@ -4880,31 +4865,11 @@ parameters: count: 1 path: libraries/classes/InsertEdit.php - - - message: "#^Parameter \\#3 \\$backupField of method PhpMyAdmin\\\\InsertEdit\\:\\:getValueColumnForOtherDatatypes\\(\\) expects string, mixed given\\.$#" - count: 1 - path: libraries/classes/InsertEdit.php - - message: "#^Parameter \\#3 \\$row of static method PhpMyAdmin\\\\Util\\:\\:getUniqueCondition\\(\\) expects array\\, mixed given\\.$#" count: 1 path: libraries/classes/InsertEdit.php - - - message: "#^Parameter \\#3 \\$specialChars of method PhpMyAdmin\\\\InsertEdit\\:\\:getHtmlInput\\(\\) expects string, mixed given\\.$#" - count: 1 - path: libraries/classes/InsertEdit.php - - - - message: "#^Parameter \\#4 \\$data of method PhpMyAdmin\\\\ConfigStorage\\\\Relation\\:\\:foreignDropdown\\(\\) expects string, mixed given\\.$#" - count: 1 - path: libraries/classes/InsertEdit.php - - - - message: "#^Parameter \\#7 \\$specialChars of method PhpMyAdmin\\\\InsertEdit\\:\\:getValueColumnForOtherDatatypes\\(\\) expects string, mixed given\\.$#" - count: 1 - path: libraries/classes/InsertEdit.php - - message: "#^Binary operation \"\\-\" between string and 1 results in an error\\.$#" count: 1 diff --git a/psalm-baseline.xml b/psalm-baseline.xml index 4c6a5bbc80..69e6931fde 100644 --- a/psalm-baseline.xml +++ b/psalm-baseline.xml @@ -7914,7 +7914,6 @@ - $backupField @@ -7949,9 +7948,6 @@ - $data - $data - $data @@ -7966,9 +7962,6 @@ $rows[$keyId] $singleQuery $singleQuery - $specialChars - $specialChars - $specialCharsEncoded getScripts()]]>