Skip to content

Commit

Permalink
Allow passing null to $prettyVersion to handle gracefully cases where…
Browse files Browse the repository at this point in the history
… a version could not be parsed upstream, refs #10631
  • Loading branch information
Seldaek committed Mar 30, 2022
1 parent 146e036 commit f1e3ba7
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/Composer/Repository/PlatformRepository.php
Expand Up @@ -659,15 +659,18 @@ private function buildPackageName(string $name): string

/**
* @param string $name
* @param string $prettyVersion
* @param string|null $prettyVersion
* @param string|null $description
* @param string[] $replaces
* @param string[] $provides
*
* @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 {
$version = $this->versionParser->normalize($prettyVersion);
} catch (\UnexpectedValueException $e) {
Expand Down

0 comments on commit f1e3ba7

Please sign in to comment.