Skip to content

Commit

Permalink
Fixed compatibility with composer 2.x fxpio#38
Browse files Browse the repository at this point in the history
Use php native `version_compare()` to fix bug in current composer `2.1.3`
  • Loading branch information
dsturm authored Jun 14, 2021
1 parent 3f00261 commit 553ef67
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion Util/LockerUtil.php
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ public static function getLocker(IOInterface $io, RepositoryManager $rm, Install
{
$lockFile = str_replace('.json', '.lock', $composerFile);
// @codeCoverageIgnoreStart
return \defined('Composer\Composer::RUNTIME_API_VERSION') && '2.0.0' === Composer::RUNTIME_API_VERSION
return \defined('Composer\Composer::RUNTIME_API_VERSION') && version_compare(Composer::RUNTIME_API_VERSION, '2.0.0', '>=')
? new Locker($io, new JsonFile($lockFile, null, $io), $im, file_get_contents($composerFile))
: new Locker($io, new JsonFile($lockFile, null, $io), $rm, $im, file_get_contents($composerFile));
}
Expand Down

0 comments on commit 553ef67

Please sign in to comment.