From 7d99a56332895b863ad672457abe07b052a46d9a Mon Sep 17 00:00:00 2001 From: Jordi Boggiano Date: Thu, 29 Aug 2019 15:16:34 +0200 Subject: [PATCH] Combine conditionals in one --- src/Composer/Repository/PathRepository.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Composer/Repository/PathRepository.php b/src/Composer/Repository/PathRepository.php index 20dcbcd6f..6e218f159 100644 --- a/src/Composer/Repository/PathRepository.php +++ b/src/Composer/Repository/PathRepository.php @@ -155,8 +155,8 @@ class PathRepository extends ArrayRepository implements ConfigurableRepositoryIn if (!isset($package['version'])) { $versionData = $this->versionGuesser->guessVersion($package, $path); - if (is_array($versionData)) { - $package['version'] = $versionData['pretty_version'] ?: 'dev-master'; + if (is_array($versionData) && $versionData['pretty_version']) { + $package['version'] = $versionData['pretty_version']; } else { $package['version'] = 'dev-master'; }