diff --git a/composer.json b/composer.json index 36573d7a..d6b8f85a 100644 --- a/composer.json +++ b/composer.json @@ -21,6 +21,9 @@ "symfony/phpunit-bridge": "^5.4|^6.0", "symfony/process": "^5.4|^6.0" }, + "conflict": { + "composer/semver": "<1.7.2" + }, "autoload": { "psr-4": { "Symfony\\Flex\\": "src" diff --git a/src/Flex.php b/src/Flex.php index 97b6491f..77a9a69f 100644 --- a/src/Flex.php +++ b/src/Flex.php @@ -293,6 +293,10 @@ public function recordOperations(InstallerEvent $event) $versionParser = new VersionParser(); $packages = []; foreach ($this->lock->all() as $name => $info) { + if ('9999999.9999999' === $info['version']) { + // Fix invalid versions found in some lock files + $info['version'] = '99999.9999999'; + } $packages[] = new Package($name, $versionParser->normalize($info['version']), $info['version']); }