Skip to content

Commit

Permalink
Merge pull request #51 from nathandaly/getpostcodes-patch-1
Browse files Browse the repository at this point in the history
Fixing Array to string conversion warning on getPoscodes method
  • Loading branch information
JustSteveKing authored Sep 12, 2023
2 parents 72d344e + d74267f commit 1d8158e
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/Service/PostcodeService.php
Original file line number Diff line number Diff line change
Expand Up @@ -89,12 +89,14 @@ public function getPostcode(string $postcode): object
*/
public function getPostcodes(array $postcodes, array $filter = []): Collection
{
$queryParams = '';

if (!empty($filter)) {
$filter = Query::build(['filter' => implode(',', $filter)]);
$queryParams = Query::build(['filter' => implode(',', $filter)]);
}

return collect($this->getResponse(
'postcodes?' . $filter,
'postcodes?' . $queryParams,
'POST',
['postcodes' => array_values($postcodes)]
))->map(function ($item) {
Expand Down

0 comments on commit 1d8158e

Please sign in to comment.