KnpLabs / packagist-api

PHP API for Packagist
MIT License
182 stars 46 forks source link

Fix bug where null downlaods from Packagist API would result in an internal error #85

Closed robbieaverill closed 2 years ago

robbieaverill commented 2 years ago

Fixes #84

cc @garak @JellyBellyDev

robbieaverill commented 2 years ago

Hmm, $client->get('happyr/translation-bundle') returns the correct number of downloads. This means that /packages/happyr/translation-bundle.json includes this metadata but /p/happyr/translation-bundle.json does not. In this case I think we should make the downloads property nullable on Package instead of hydrating a Downloads object with 0 in it, since this is misleading.

JellyBellyDev commented 2 years ago

LGTM 👍