diff --git a/src/Composer/Repository/PlatformRepository.php b/src/Composer/Repository/PlatformRepository.php index 550d180db..2b462fca9 100644 --- a/src/Composer/Repository/PlatformRepository.php +++ b/src/Composer/Repository/PlatformRepository.php @@ -70,7 +70,8 @@ class PlatformRepository extends ArrayRepository $version = $versionParser->normalize($prettyVersion); } - $ext = new CompletePackage('ext-'.$name, $version, $prettyVersion); + $packageName = $this->buildPackageName($name); + $ext = new CompletePackage($packageName, $version, $prettyVersion); $ext->setDescription('The '.$name.' PHP extension'); parent::addPackage($ext); } @@ -159,4 +160,10 @@ class PlatformRepository extends ArrayRepository parent::addPackage($hhvm); } } + + + private function buildPackageName($name) + { + return 'ext-' . str_replace(' ', '-', $name); + } }