Skip to content

Commit

Permalink
Merge pull request #1 from jr-k/patch-2
Browse files Browse the repository at this point in the history
Missing object case in Builder::buildEndpoint
  • Loading branch information
jr-k authored Jul 12, 2022
2 parents af6429a + fa728a8 commit b68bbe8
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/Builder.php
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,14 @@ public function buildEndpoint($options = [])
continue;
}

if (is_object($value)) {
if (isset($value->id)) {
$value = $value->id;
} else {
continue;
}
}

$endpoint = preg_replace("/:{$key}/", $value, $endpoint);
}

Expand Down

0 comments on commit b68bbe8

Please sign in to comment.