Skip to content

Commit

Permalink
Replace HTTPlug factories by PSR-17 (#1184)
Browse files Browse the repository at this point in the history
* Replace HTTPlug factories by PSR-17

* minor fix

---------

Co-authored-by: Nyholm <[email protected]>
  • Loading branch information
nicolas-grekas and Nyholm committed Dec 15, 2023
1 parent 33a88fc commit d3455c2
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 12 deletions.
5 changes: 0 additions & 5 deletions GoogleMaps.php
Original file line number Diff line number Diff line change
Expand Up @@ -158,8 +158,6 @@ public function getName(): string
}

/**
* @param string $locale
*
* @return string query with extra params
*/
private function buildQuery(string $url, string $locale = null, string $region = null): string
Expand Down Expand Up @@ -196,9 +194,6 @@ private function buildQuery(string $url, string $locale = null, string $region =
}

/**
* @param string $locale
* @param string $region
*
* @throws InvalidServerResponse
* @throws InvalidCredentials
*/
Expand Down
2 changes: 0 additions & 2 deletions Model/GoogleAddress.php
Original file line number Diff line number Diff line change
Expand Up @@ -381,8 +381,6 @@ public function getPremise()
}

/**
* @param string $premise
*
* @return GoogleAddress
*/
public function withPremise(string $premise = null)
Expand Down
4 changes: 2 additions & 2 deletions Readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ This is the Google Maps provider from the PHP Geocoder. This is a **READ ONLY**
## Usage

```php
$httpClient = new \GuzzleHttp\Client();
$httpClient = new \Http\Discovery\Psr18Client();

// You must provide an API key
$provider = new \Geocoder\Provider\GoogleMaps\GoogleMaps($httpClient, null, 'your-api-key');
Expand All @@ -31,7 +31,7 @@ can use the static `business` method on the provider to create a client:

```php

$httpClient = new \GuzzleHttp\Client();
$httpClient = new \Http\Discovery\Psr18Client();

// Client ID is required. Private key is optional.
$provider = \Geocoder\Provider\GoogleMaps\GoogleMaps::business($httpClient, 'your-client-id', 'your-private-key');
Expand Down
5 changes: 2 additions & 3 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,7 @@
"geocoder-php/provider-implementation": "1.0"
},
"require-dev": {
"geocoder-php/provider-integration-tests": "^1.0",
"php-http/curl-client": "^2.2",
"geocoder-php/provider-integration-tests": "^1.6.3",
"php-http/message": "^1.0",
"phpunit/phpunit": "^9.5"
},
Expand All @@ -44,4 +43,4 @@
"test": "vendor/bin/phpunit",
"test-ci": "vendor/bin/phpunit --coverage-text --coverage-clover=build/coverage.xml"
}
}
}

0 comments on commit d3455c2

Please sign in to comment.