Skip to content

Commit

Permalink
Fix issue in VersionInformation class reported by PHPStan
Browse files Browse the repository at this point in the history
Signed-off-by: Maurício Meneghini Fauth <mauricio@fauth.dev>
  • Loading branch information
MauricioFauth committed Mar 31, 2022
1 parent 5b03d32 commit 05bd23a
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 6 deletions.
3 changes: 2 additions & 1 deletion libraries/classes/VersionInformation.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
use function intval;
use function is_numeric;
use function is_object;
use function is_string;
use function json_decode;
use function preg_match;
use function strlen;
Expand Down Expand Up @@ -228,7 +229,7 @@ public function evaluateVersionCondition(string $type, string $condition)
$myVersion = $this->getMySQLVersion();
}

if ($myVersion !== null && $version !== null && $operator !== null) {
if (is_string($myVersion) && is_string($version) && is_string($operator)) {
return version_compare($myVersion, $version, $operator);
}

Expand Down
5 changes: 0 additions & 5 deletions phpstan-baseline.neon
Original file line number Diff line number Diff line change
Expand Up @@ -4375,11 +4375,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
Expand Down

0 comments on commit 05bd23a

Please sign in to comment.