From e700e6fcd9487d7db3efd6ae2796c00aa6bc3887 Mon Sep 17 00:00:00 2001 From: Jordi Boggiano Date: Wed, 21 Sep 2011 23:03:59 +0200 Subject: [PATCH] Use new version parser in PlatformRepository --- src/Composer/Repository/PlatformRepository.php | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/Composer/Repository/PlatformRepository.php b/src/Composer/Repository/PlatformRepository.php index 70910e3ad..5a94eee55 100644 --- a/src/Composer/Repository/PlatformRepository.php +++ b/src/Composer/Repository/PlatformRepository.php @@ -25,10 +25,12 @@ class PlatformRepository extends ArrayRepository { parent::initialize(); + $versionParser = new VersionParser(); + try { - $version = BasePackage::parseVersion(PHP_VERSION); + $version = $versionParser->parse(PHP_VERSION); } catch (\UnexpectedValueException $e) { - $version = BasePackage::parseVersion(preg_replace('#^(.+?)(-.+)?$#', '$1', PHP_VERSION)); + $version = $versionParser->parse(preg_replace('#^(.+?)(-.+)?$#', '$1', PHP_VERSION)); } $php = new MemoryPackage('php', $version['version'], $version['type']); @@ -41,7 +43,7 @@ class PlatformRepository extends ArrayRepository $reflExt = new \ReflectionExtension($ext); try { - $version = BasePackage::parseVersion($reflExt->getVersion()); + $version = $versionParser->parse($reflExt->getVersion()); } catch (\UnexpectedValueException $e) { $version = array('version' => '0', 'type' => 'stable'); }