Skip to content

Commit

Permalink
fix missing versions details in the package object (#863)
Browse files Browse the repository at this point in the history
* fix missing versions details in the package object
* added casting on latestVersion
  • Loading branch information
fabiocicerchia authored Oct 16, 2022
1 parent 5f776ac commit 13181b4
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions src/Badge/Model/Package.php
Original file line number Diff line number Diff line change
Expand Up @@ -87,11 +87,8 @@ private function calculateLatestVersions(): void
$functionName = 'Stable';
}

if (null === $latest = $this->{'getLatest'.$functionName.'VersionNormalized'}()) {
continue;
}

if (\version_compare($versionNormalized, $latest) > 0) {
$latestVersion = (string) $this->{'getLatest'.$functionName.'VersionNormalized'}();
if (\version_compare($versionNormalized, $latestVersion) > 0) {
$this->{'setLatest'.$functionName.'Version'}($currentVersionName);
$this->{'setLatest'.$functionName.'VersionNormalized'}($versionNormalized);
/** @var string|string[] $license */
Expand Down

0 comments on commit 13181b4

Please sign in to comment.