error when requesting additional fields
$client->all(['fields' => ['abandoned','repository','type']);
Generates an error because source isn't set in $version:
I'll submit a PR
Actually, my PR isn't sufficient.
The problem is that the return value when passing 'fields' to list.json is an array of those fields.
public function createPackageResults(array $package): Package
{
dd($package);
returns
Hi @tacman, would you be interested in submitting another PR to fix this?
Can you point me in the right direction? For the project I was working on, I simply filtered them after retrieving.
It seems like the error is caused by the code expecting the 'source' key to exist. In your example you're filtering fields and 'source' isn't one of those included. Perhaps a change like this might be sufficient to fix the issue:
- if ($version['source']) {
+ if (!empty($version['source'])) {
That's what I did in https://github.com/KnpLabs/packagist-api/pull/102, but it wasn't enough.