diff --git a/src/Packagist/Api/Client.php b/src/Packagist/Api/Client.php index b61f2c1..2970dfc 100644 --- a/src/Packagist/Api/Client.php +++ b/src/Packagist/Api/Client.php @@ -76,7 +76,10 @@ public function search(string $query, array $filters = [], int $limit = 0): arra $createResult = [$createResult]; } $results = array_merge($results, $createResult); - } while (isset($response['next']) && (0 === $limit || $response['next'] <= $limit)); + if (isset($response['next'])) { + parse_str(parse_url($response['next'], PHP_URL_QUERY), $parse); + } + } while (isset($response['next']) && (0 === $limit || $parse['page'] <= $limit)); return $results; }