Skip to content

Commit

Permalink
fix limit check in search
Browse files Browse the repository at this point in the history
  • Loading branch information
garak committed Dec 3, 2020
1 parent f97886d commit 3bd3a7b
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/Packagist/Api/Client.php
Expand Up @@ -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;
}
Expand Down

0 comments on commit 3bd3a7b

Please sign in to comment.