1
0
Fork 0

Fix: Return early

pull/8718/head
Andreas Möller 2020-03-29 12:18:56 +02:00
parent 0663eb5ef7
commit 6e88683e35
No known key found for this signature in database
GPG Key ID: 9FB20A0BAF60E11F
1 changed files with 19 additions and 17 deletions

View File

@ -63,26 +63,28 @@ class VersionGuesser
*/ */
public function guessVersion(array $packageConfig, $path) public function guessVersion(array $packageConfig, $path)
{ {
if (function_exists('proc_open')) { if (!function_exists('proc_open')) {
$versionData = $this->guessGitVersion($packageConfig, $path); return;
if (null !== $versionData && null !== $versionData['version']) { }
return $this->postprocess($versionData);
}
$versionData = $this->guessHgVersion($packageConfig, $path); $versionData = $this->guessGitVersion($packageConfig, $path);
if (null !== $versionData && null !== $versionData['version']) { if (null !== $versionData && null !== $versionData['version']) {
return $this->postprocess($versionData); return $this->postprocess($versionData);
} }
$versionData = $this->guessFossilVersion($packageConfig, $path); $versionData = $this->guessHgVersion($packageConfig, $path);
if (null !== $versionData && null !== $versionData['version']) { if (null !== $versionData && null !== $versionData['version']) {
return $this->postprocess($versionData); return $this->postprocess($versionData);
} }
$versionData = $this->guessSvnVersion($packageConfig, $path); $versionData = $this->guessFossilVersion($packageConfig, $path);
if (null !== $versionData && null !== $versionData['version']) { if (null !== $versionData && null !== $versionData['version']) {
return $this->postprocess($versionData); return $this->postprocess($versionData);
} }
$versionData = $this->guessSvnVersion($packageConfig, $path);
if (null !== $versionData && null !== $versionData['version']) {
return $this->postprocess($versionData);
} }
} }