From e84d7ad050db52c623554d03491f2b93eac0f8e1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jonathan=20Beli=C3=ABn?= Date: Sat, 2 Mar 2024 12:00:56 +0100 Subject: [PATCH] =?UTF-8?q?=F0=9F=9A=A8=20Apply=20PHP=20CS=20Fixer=20fixes?= =?UTF-8?q?=20(#1219)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Mapbox.php | 6 +++--- Model/MapboxAddress.php | 10 +++++----- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/Mapbox.php b/Mapbox.php index 97cf64f..be33073 100644 --- a/Mapbox.php +++ b/Mapbox.php @@ -148,7 +148,7 @@ final class Mapbox extends AbstractHttpProvider implements Provider public function __construct( ClientInterface $client, string $accessToken, - string $country = null, + ?string $country = null, string $geocodingMode = self::GEOCODING_MODE_PLACES ) { parent::__construct($client); @@ -232,7 +232,7 @@ public function getName(): string /** * @return string query with extra params */ - private function buildQuery(string $url, int $limit, string $locale = null, string $country = null): string + private function buildQuery(string $url, int $limit, ?string $locale = null, ?string $country = null): string { $parameters = array_filter([ 'country' => $country, @@ -246,7 +246,7 @@ private function buildQuery(string $url, int $limit, string $locale = null, stri return $url.$separator.http_build_query($parameters); } - private function fetchUrl(string $url, int $limit, string $locale = null, string $country = null): AddressCollection + private function fetchUrl(string $url, int $limit, ?string $locale = null, ?string $country = null): AddressCollection { $url = $this->buildQuery($url, $limit, $locale, $country); $content = $this->getUrlContents($url); diff --git a/Model/MapboxAddress.php b/Model/MapboxAddress.php index 676d1a7..b767f32 100644 --- a/Model/MapboxAddress.php +++ b/Model/MapboxAddress.php @@ -46,7 +46,7 @@ final class MapboxAddress extends Address */ private $neighborhood; - public function withId(string $id = null): self + public function withId(?string $id = null): self { $new = clone $this; $new->id = $id; @@ -67,7 +67,7 @@ public function getStreetName(): ?string return $this->streetName; } - public function withStreetName(string $streetName = null): self + public function withStreetName(?string $streetName = null): self { $new = clone $this; $new->streetName = $streetName; @@ -80,7 +80,7 @@ public function getStreetNumber(): ?string return $this->streetNumber; } - public function withStreetNumber(string $streetNumber = null): self + public function withStreetNumber(?string $streetNumber = null): self { $new = clone $this; $new->streetNumber = $streetNumber; @@ -112,7 +112,7 @@ public function getFormattedAddress(): ?string return $this->formattedAddress; } - public function withFormattedAddress(string $formattedAddress = null): self + public function withFormattedAddress(?string $formattedAddress = null): self { $new = clone $this; $new->formattedAddress = $formattedAddress; @@ -125,7 +125,7 @@ public function getNeighborhood(): ?string return $this->neighborhood; } - public function withNeighborhood(string $neighborhood = null): self + public function withNeighborhood(?string $neighborhood = null): self { $new = clone $this; $new->neighborhood = $neighborhood;