Skip to content

Commit 0bf861d

Browse files
Merge pull request #18421 from kamil-tekiela/versionToInt
versionToInt never returns false
2 parents 15ab473 + ca1ec6d commit 0bf861d

3 files changed

Lines changed: 1 addition & 28 deletions

File tree

‎libraries/classes/Setup/Index.php‎

Lines changed: 0 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -140,28 +140,8 @@ public static function versionCheck(): void
140140
$date = $latestCompatible['date'];
141141

142142
$versionUpstream = $versionInformation->versionToInt($version);
143-
if ($versionUpstream === false) {
144-
self::messagesSet(
145-
'error',
146-
$messageId,
147-
__('Version check'),
148-
__('Got invalid version string from server'),
149-
);
150-
151-
return;
152-
}
153143

154144
$versionLocal = $versionInformation->versionToInt(Version::VERSION);
155-
if ($versionLocal === false) {
156-
self::messagesSet(
157-
'error',
158-
$messageId,
159-
__('Version check'),
160-
__('Unparsable version string'),
161-
);
162-
163-
return;
164-
}
165145

166146
if ($versionUpstream > $versionLocal) {
167147
$version = htmlspecialchars($version);

‎libraries/classes/VersionInformation.php‎

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -77,10 +77,8 @@ public function getLatestVersion(): stdClass|null
7777
* Calculates numerical equivalent of phpMyAdmin version string
7878
*
7979
* @param string $version version
80-
*
81-
* @return mixed false on failure, integer on success
8280
*/
83-
public function versionToInt(string $version): mixed
81+
public function versionToInt(string $version): int
8482
{
8583
$parts = explode('-', $version);
8684
if (count($parts) > 1) {

‎psalm-baseline.xml‎

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12573,12 +12573,7 @@
1257312573
<code>$removeIds[]</code>
1257412574
<code>$type</code>
1257512575
<code>$version</code>
12576-
<code>$versionLocal</code>
12577-
<code>$versionUpstream</code>
1257812576
</MixedAssignment>
12579-
<MixedOperand>
12580-
<code>$versionLocal</code>
12581-
</MixedOperand>
1258212577
</file>
1258312578
<file src="libraries/classes/Sql.php">
1258412579
<DeprecatedMethod>

0 commit comments

Comments
 (0)