diff --git a/src/Composer/Repository/PathRepository.php b/src/Composer/Repository/PathRepository.php index 8d4e9919d..0b078749a 100644 --- a/src/Composer/Repository/PathRepository.php +++ b/src/Composer/Repository/PathRepository.php @@ -129,7 +129,8 @@ class PathRepository extends ArrayRepository implements ConfigurableRepositoryIn ); if (!isset($package['version'])) { - $package['version'] = $this->versionGuesser->guessVersion($package, $path)['version'] ?: 'dev-master'; + $versionData = $this->versionGuesser->guessVersion($package, $path); + $package['version'] = $versionData['version'] ?: 'dev-master'; } $output = ''; diff --git a/tests/Composer/Test/Package/Version/VersionGuesserTest.php b/tests/Composer/Test/Package/Version/VersionGuesserTest.php index 02b99e971..55beac6b2 100644 --- a/tests/Composer/Test/Package/Version/VersionGuesserTest.php +++ b/tests/Composer/Test/Package/Version/VersionGuesserTest.php @@ -100,9 +100,9 @@ class VersionGuesserTest extends \PHPUnit_Framework_TestCase $config = new Config; $config->merge(array('repositories' => array('packagist' => false))); $guesser = new VersionGuesser($config, $executor, new VersionParser()); - $version = $guesser->guessVersion(array(), 'dummy/path')['version']; + $versionData = $guesser->guessVersion(array(), 'dummy/path'); - $this->assertEquals("dev-$commitHash", $version); + $this->assertEquals("dev-$commitHash", $versionData['version']); } public function testTagBecomesVersion() @@ -130,9 +130,9 @@ class VersionGuesserTest extends \PHPUnit_Framework_TestCase $config = new Config; $config->merge(array('repositories' => array('packagist' => false))); $guesser = new VersionGuesser($config, $executor, new VersionParser()); - $version = $guesser->guessVersion(array(), 'dummy/path')['version']; + $versionData = $guesser->guessVersion(array(), 'dummy/path'); - $this->assertEquals("2.0.5.0-alpha2", $version); + $this->assertEquals("2.0.5.0-alpha2", $versionData['version']); } public function testInvalidTagBecomesVersion() @@ -171,8 +171,8 @@ class VersionGuesserTest extends \PHPUnit_Framework_TestCase $config = new Config; $config->merge(array('repositories' => array('packagist' => false))); $guesser = new VersionGuesser($config, $executor, new VersionParser()); - $version = $guesser->guessVersion(array(), 'dummy/path')['version']; + $versionData = $guesser->guessVersion(array(), 'dummy/path'); - $this->assertEquals("dev-foo", $version); + $this->assertEquals("dev-foo", $versionData['version']); } }