Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

List endpoint #11

Merged
merged 28 commits into from
Sep 20, 2024
Merged

List endpoint #11

merged 28 commits into from
Sep 20, 2024

Conversation

sixlive
Copy link
Contributor

@sixlive sixlive commented Sep 13, 2024

Description

❗This PR is built off of #10

  • Adds the list endpoint functionality.
  • Breaking: Update all methods to respond in an associative array rather than a json_decode object
    • Adjust the geocoding tests accordingly
    • Groups the geocoding tests by forward/reverse using the describe method

@sixlive sixlive self-assigned this Sep 13, 2024
@sixlive sixlive marked this pull request as ready for review September 19, 2024 21:09
CHANGELOG.md Show resolved Hide resolved
# Find files fixed by pint by comparing file lists before and after pint run
files_fixed_by_format=$(comm -13 <(sort <<<"$files_before_format") <(sort <<<"$files_after_format"))

# Re-stage files fixed by pint
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice!!

composer.json Outdated
@@ -25,7 +25,8 @@
"phpunit/phpunit": "^11.0",
"projektgopher/whisky": "^0.7.0",
"rector/rector": "^1.2",
"symfony/var-dumper": "^4.3"
"symfony/var-dumper": "^4.3",
"spatie/ray": "^1.41"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

ray.php Outdated Show resolved Hide resolved

protected function formatUrl(string $endpoint): string
{
return vsprintf('https://%s/%s/%s', [
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

TIL: There's a vsprintf(...) :)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I love sprintf and vsprintf I use them all the time for string formatting.

protected function getHeaders(): array
{
return [
'User-Agent' => sprintf('geocodio-library-php/%s', Geocodio::SDK_VERSION),
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🙌

src/Geocodio.php Outdated Show resolved Hide resolved
src/Geocodio.php Outdated Show resolved Hide resolved
?string $filename = null
): Response {
if (is_file($fileContents) && ! file_exists($fileContents)) {
throw GeocodioException::fileNotFound($fileContents);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Neat!!

Base automatically changed from tooling-updates to master September 20, 2024 14:01
@sixlive sixlive merged commit 195cc2a into master Sep 20, 2024
8 checks passed
@sixlive sixlive deleted the list-endpoint branch September 20, 2024 19:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants