Skip to content

Commit

Permalink
Do not normalize current version during comparison
Browse files Browse the repository at this point in the history
  • Loading branch information
morozov committed Sep 12, 2021
1 parent f1a05f8 commit 41cb3ed
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 13 deletions.
7 changes: 3 additions & 4 deletions lib/Doctrine/DBAL/Version.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
namespace Doctrine\DBAL;

use function str_replace;
use function strtolower;
use function strtoupper;
use function version_compare;

/**
Expand All @@ -28,9 +28,8 @@ class Version
*/
public static function compare($version)
{
$currentVersion = str_replace(' ', '', strtolower(self::VERSION));
$version = str_replace(' ', '', $version);
$version = str_replace(' ', '', strtoupper($version));

return version_compare($version, $currentVersion);
return version_compare($version, self::VERSION);
}
}
9 changes: 0 additions & 9 deletions psalm.xml.dist
Original file line number Diff line number Diff line change
Expand Up @@ -311,15 +311,6 @@
<directory name="lib"/>
</errorLevel>
</RedundantCastGivenDocblockType>
<RedundantCondition>
<errorLevel type="suppress">
<!--
This suppression should be removed in 3.0.x
See https://github.com/doctrine/dbal/pull/3860
-->
<file name="lib/Doctrine/DBAL/Version.php"/>
</errorLevel>
</RedundantCondition>
<RedundantConditionGivenDocblockType>
<errorLevel type="suppress">
<!--
Expand Down

0 comments on commit 41cb3ed

Please sign in to comment.