diff --git a/src/Composer/Platform/Runtime.php b/src/Composer/Platform/Runtime.php index 725c3dbbcfce..c59e9d060640 100644 --- a/src/Composer/Platform/Runtime.php +++ b/src/Composer/Platform/Runtime.php @@ -98,7 +98,12 @@ public function getExtensions(): array */ public function getExtensionVersion(string $extension): string { - return phpversion($extension); + $version = phpversion($extension); + if ($version === false) { + $version = '0'; + } + + return $version; } /** diff --git a/src/Composer/Repository/PlatformRepository.php b/src/Composer/Repository/PlatformRepository.php index d31e0ede26f6..6cac92bec4a8 100644 --- a/src/Composer/Repository/PlatformRepository.php +++ b/src/Composer/Repository/PlatformRepository.php @@ -618,13 +618,8 @@ private function addDisabledPackage(CompletePackage $package): void /** * Parses the version and adds a new package to the repository - * - * @param string $name - * @param null|string $prettyVersion - * - * @return void */ - private function addExtension(string $name, ?string $prettyVersion): void + private function addExtension(string $name, string $prettyVersion): void { $extraDescription = null;