1
0
Fork 0

Allow passing null to $prettyVersion to handle gracefully cases where a version could not be parsed upstream, refs #10631

pull/10678/head
Jordi Boggiano 2022-03-30 18:10:07 +02:00
parent 146e036b58
commit f1e3ba74ab
No known key found for this signature in database
GPG Key ID: 7BBD42C429EC80BC
1 changed files with 5 additions and 2 deletions

View File

@ -659,15 +659,18 @@ class PlatformRepository extends ArrayRepository
/** /**
* @param string $name * @param string $name
* @param string $prettyVersion * @param string|null $prettyVersion
* @param string|null $description * @param string|null $description
* @param string[] $replaces * @param string[] $replaces
* @param string[] $provides * @param string[] $provides
* *
* @return void * @return void
*/ */
private function addLibrary(string $name, string $prettyVersion, ?string $description = null, array $replaces = array(), array $provides = array()): void private function addLibrary(string $name, ?string $prettyVersion, ?string $description = null, array $replaces = array(), array $provides = array()): void
{ {
if (null === $prettyVersion) {
return;
}
try { try {
$version = $this->versionParser->normalize($prettyVersion); $version = $this->versionParser->normalize($prettyVersion);
} catch (\UnexpectedValueException $e) { } catch (\UnexpectedValueException $e) {