Skip to content

Commit 05bd23a

Browse files
committed
Fix issue in VersionInformation class reported by PHPStan
Signed-off-by: Maurício Meneghini Fauth <mauricio@fauth.dev>
1 parent 5b03d32 commit 05bd23a

2 files changed

Lines changed: 2 additions & 6 deletions

File tree

libraries/classes/VersionInformation.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
use function intval;
1616
use function is_numeric;
1717
use function is_object;
18+
use function is_string;
1819
use function json_decode;
1920
use function preg_match;
2021
use function strlen;
@@ -228,7 +229,7 @@ public function evaluateVersionCondition(string $type, string $condition)
228229
$myVersion = $this->getMySQLVersion();
229230
}
230231

231-
if ($myVersion !== null && $version !== null && $operator !== null) {
232+
if (is_string($myVersion) && is_string($version) && is_string($operator)) {
232233
return version_compare($myVersion, $version, $operator);
233234
}
234235

phpstan-baseline.neon

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4375,11 +4375,6 @@ parameters:
43754375
count: 1
43764376
path: libraries/classes/IndexColumn.php
43774377

4378-
-
4379-
message: "#^Else branch is unreachable because ternary operator condition is always true\\.$#"
4380-
count: 1
4381-
path: libraries/classes/InsertEdit.php
4382-
43834378
-
43844379
message: "#^Method PhpMyAdmin\\\\InsertEdit\\:\\:analyzeTableColumnsArray\\(\\) has parameter \\$column with no value type specified in iterable type array\\.$#"
43854380
count: 1

0 commit comments

Comments
 (0)