Skip to content

Commit

Permalink
🚨 Apply PHP CS Fixer fixes (#1219)
Browse files Browse the repository at this point in the history
  • Loading branch information
jbelien authored Mar 2, 2024
1 parent b0a94d9 commit f5ff3ed
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 25 deletions.
14 changes: 7 additions & 7 deletions GoogleMaps.php
Original file line number Diff line number Diff line change
Expand Up @@ -83,10 +83,10 @@ final class GoogleMaps extends AbstractHttpProvider implements Provider
public static function business(
ClientInterface $client,
string $clientId,
string $privateKey = null,
string $region = null,
string $apiKey = null,
string $channel = null
?string $privateKey = null,
?string $region = null,
?string $apiKey = null,
?string $channel = null
) {
$provider = new self($client, $region, $apiKey);
$provider->clientId = $clientId;
Expand All @@ -101,7 +101,7 @@ public static function business(
* @param string $region Region biasing (optional)
* @param string $apiKey Google Geocoding API key (optional)
*/
public function __construct(ClientInterface $client, string $region = null, string $apiKey = null)
public function __construct(ClientInterface $client, ?string $region = null, ?string $apiKey = null)
{
parent::__construct($client);

Expand Down Expand Up @@ -160,7 +160,7 @@ public function getName(): string
/**
* @return string query with extra params
*/
private function buildQuery(string $url, string $locale = null, string $region = null): string
private function buildQuery(string $url, ?string $locale = null, ?string $region = null): string
{
if (null === $this->apiKey && null === $this->clientId) {
throw new InvalidCredentials('You must provide an API key. Keyless access was removed in June, 2016');
Expand Down Expand Up @@ -197,7 +197,7 @@ private function buildQuery(string $url, string $locale = null, string $region =
* @throws InvalidServerResponse
* @throws InvalidCredentials
*/
private function fetchUrl(string $url, string $locale = null, int $limit, string $region = null): AddressCollection
private function fetchUrl(string $url, ?string $locale = null, int $limit, ?string $region = null): AddressCollection
{
$url = $this->buildQuery($url, $locale, $region);
$content = $this->getUrlContents($url);
Expand Down
34 changes: 17 additions & 17 deletions Model/GoogleAddress.php
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ final class GoogleAddress extends Address
/**
* @return GoogleAddress
*/
public function withId(string $id = null)
public function withId(?string $id = null)
{
$new = clone $this;
$new->id = $id;
Expand All @@ -145,7 +145,7 @@ public function getId()
/**
* @return GoogleAddress
*/
public function withLocationType(string $locationType = null)
public function withLocationType(?string $locationType = null)
{
$new = clone $this;
$new->locationType = $locationType;
Expand Down Expand Up @@ -193,7 +193,7 @@ public function getFormattedAddress()
/**
* @return GoogleAddress
*/
public function withFormattedAddress(string $formattedAddress = null)
public function withFormattedAddress(?string $formattedAddress = null)
{
$new = clone $this;
$new->formattedAddress = $formattedAddress;
Expand All @@ -212,7 +212,7 @@ public function getAirport()
/**
* @return GoogleAddress
*/
public function withAirport(string $airport = null)
public function withAirport(?string $airport = null)
{
$new = clone $this;
$new->airport = $airport;
Expand All @@ -231,7 +231,7 @@ public function getColloquialArea()
/**
* @return GoogleAddress
*/
public function withColloquialArea(string $colloquialArea = null)
public function withColloquialArea(?string $colloquialArea = null)
{
$new = clone $this;
$new->colloquialArea = $colloquialArea;
Expand All @@ -250,7 +250,7 @@ public function getIntersection()
/**
* @return GoogleAddress
*/
public function withIntersection(string $intersection = null)
public function withIntersection(?string $intersection = null)
{
$new = clone $this;
$new->intersection = $intersection;
Expand All @@ -269,7 +269,7 @@ public function getPostalCodeSuffix()
/**
* @return GoogleAddress
*/
public function withPostalCodeSuffix(string $postalCodeSuffix = null)
public function withPostalCodeSuffix(?string $postalCodeSuffix = null)
{
$new = clone $this;
$new->postalCodeSuffix = $postalCodeSuffix;
Expand All @@ -288,7 +288,7 @@ public function getNaturalFeature()
/**
* @return GoogleAddress
*/
public function withNaturalFeature(string $naturalFeature = null)
public function withNaturalFeature(?string $naturalFeature = null)
{
$new = clone $this;
$new->naturalFeature = $naturalFeature;
Expand All @@ -307,7 +307,7 @@ public function getNeighborhood()
/**
* @return GoogleAddress
*/
public function withNeighborhood(string $neighborhood = null)
public function withNeighborhood(?string $neighborhood = null)
{
$new = clone $this;
$new->neighborhood = $neighborhood;
Expand All @@ -326,7 +326,7 @@ public function getPark()
/**
* @return GoogleAddress
*/
public function withPark(string $park = null)
public function withPark(?string $park = null)
{
$new = clone $this;
$new->park = $park;
Expand All @@ -345,7 +345,7 @@ public function getPointOfInterest()
/**
* @return GoogleAddress
*/
public function withPointOfInterest(string $pointOfInterest = null)
public function withPointOfInterest(?string $pointOfInterest = null)
{
$new = clone $this;
$new->pointOfInterest = $pointOfInterest;
Expand All @@ -364,7 +364,7 @@ public function getPolitical()
/**
* @return GoogleAddress
*/
public function withPolitical(string $political = null)
public function withPolitical(?string $political = null)
{
$new = clone $this;
$new->political = $political;
Expand All @@ -383,7 +383,7 @@ public function getPremise()
/**
* @return GoogleAddress
*/
public function withPremise(string $premise = null)
public function withPremise(?string $premise = null)
{
$new = clone $this;
$new->premise = $premise;
Expand All @@ -402,7 +402,7 @@ public function getStreetAddress()
/**
* @return GoogleAddress
*/
public function withStreetAddress(string $streetAddress = null)
public function withStreetAddress(?string $streetAddress = null)
{
$new = clone $this;
$new->streetAddress = $streetAddress;
Expand All @@ -421,7 +421,7 @@ public function getSubpremise()
/**
* @return GoogleAddress
*/
public function withSubpremise(string $subpremise = null)
public function withSubpremise(?string $subpremise = null)
{
$new = clone $this;
$new->subpremise = $subpremise;
Expand All @@ -440,7 +440,7 @@ public function getWard()
/**
* @return GoogleAddress
*/
public function withWard(string $ward = null)
public function withWard(?string $ward = null)
{
$new = clone $this;
$new->ward = $ward;
Expand All @@ -459,7 +459,7 @@ public function getEstablishment()
/**
* @return GoogleAddress
*/
public function withEstablishment(string $establishment = null)
public function withEstablishment(?string $establishment = null)
{
$new = clone $this;
$new->establishment = $establishment;
Expand Down
2 changes: 1 addition & 1 deletion Tests/GoogleMapsTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ public function testGeocodeBoundsWithRealAddressForNonRooftopLocation(): void

public function testReverse(): void
{
$this->expectException(\Geocoder\Exception\InvalidServerResponse::class);
$this->expectException(InvalidServerResponse::class);

$provider = new GoogleMaps($this->getMockedHttpClient(), null, 'mock-api-key');
$provider->reverseQuery(ReverseQuery::fromCoordinates(1, 2));
Expand Down

0 comments on commit f5ff3ed

Please sign in to comment.