From ca1ec6d4c2a1d019c98e500c43c20a6f8e7d7fc0 Mon Sep 17 00:00:00 2001 From: Kamil Tekiela Date: Fri, 12 May 2023 21:52:17 +0100 Subject: [PATCH] versionToInt never returns false Signed-off-by: Kamil Tekiela --- libraries/classes/Setup/Index.php | 20 -------------------- libraries/classes/VersionInformation.php | 4 +--- psalm-baseline.xml | 5 ----- 3 files changed, 1 insertion(+), 28 deletions(-) diff --git a/libraries/classes/Setup/Index.php b/libraries/classes/Setup/Index.php index f03a1bbd7a..76a1c9f600 100644 --- a/libraries/classes/Setup/Index.php +++ b/libraries/classes/Setup/Index.php @@ -140,28 +140,8 @@ class Index $date = $latestCompatible['date']; $versionUpstream = $versionInformation->versionToInt($version); - if ($versionUpstream === false) { - self::messagesSet( - 'error', - $messageId, - __('Version check'), - __('Got invalid version string from server'), - ); - - return; - } $versionLocal = $versionInformation->versionToInt(Version::VERSION); - if ($versionLocal === false) { - self::messagesSet( - 'error', - $messageId, - __('Version check'), - __('Unparsable version string'), - ); - - return; - } if ($versionUpstream > $versionLocal) { $version = htmlspecialchars($version); diff --git a/libraries/classes/VersionInformation.php b/libraries/classes/VersionInformation.php index 9ff11b3d24..db53a82359 100644 --- a/libraries/classes/VersionInformation.php +++ b/libraries/classes/VersionInformation.php @@ -77,10 +77,8 @@ class VersionInformation * Calculates numerical equivalent of phpMyAdmin version string * * @param string $version version - * - * @return mixed false on failure, integer on success */ - public function versionToInt(string $version): mixed + public function versionToInt(string $version): int { $parts = explode('-', $version); if (count($parts) > 1) { diff --git a/psalm-baseline.xml b/psalm-baseline.xml index 07dc380b56..66aa6fbf64 100644 --- a/psalm-baseline.xml +++ b/psalm-baseline.xml @@ -12588,12 +12588,7 @@ $removeIds[] $type $version - $versionLocal - $versionUpstream - - $versionLocal -