8000 🚨 Apply PHP CS Fixer fixes (#1219) · geocoder-php/php-common@7147850 · GitHub
[go: up one dir, main page]

Skip to content

Commit 7147850

Browse files
authored
🚨 Apply PHP CS Fixer fixes (#1219)
1 parent f1e4dd5 commit 7147850

10 files changed

+20
-20
lines changed

‎Collection.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ public function isEmpty(): bool;
3535
/**
3636
* @return Location[]
3737
*/
38-
public function slice(int $offset, int $length = null);
38+
public function slice(int $offset, ?int $length = null);
3939

4040
public function has(int $index): bool;
4141

‎Geocoder.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,14 +34,14 @@ interface Geocoder extends Provider
3434
/**
3535
* Geocodes a given value.
3636
*
37-
* @throws \Geocoder\Exception\Exception
37+
* @throws Exception\Exception
3838
*/
3939
public function geocode(string $value): Collection;
4040

4141
/**
4242
* Reverses geocode given latitude and longitude values.
4343
*
44-
* @throws \Geocoder\Exception\Exception
44+
* @throws Exception\Exception
4545
*/
4646
public function reverse(float $latitude, float $longitude): Collection;
4747
}

‎Model/Address.php

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -77,15 +77,15 @@ class Address implements Location
7777
final public function __construct(
7878
string $providedBy,
7979
AdminLevelCollection $adminLevels,
80-
Coordinates $coordinates = null,
81-
Bounds $bounds = null,
82-
string $streetNumber = null,
83-
string $streetName = null,
84-
string $postalCode = null,
85-
string $locality = null,
86-
string $subLocality = null,
87-
Country $country = null,
88-
string $timezone = null
80+
?Coordinates $coordinates = null,
81+
?Bounds $bounds = null,
82+
?string $streetNumber = null,
83+
?string $streetName = null,
84+
?string $postalCode = null,
85+
?string $locality = null,
86+
?string $subLocality = null,
87+
?Country $country = null,
88+
?string $timezone = null
8989
) {
9090
$this->providedBy = $providedBy;
9191
$this->adminLevels = $adminLevels;

‎Model/AddressBuilder.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -152,7 +152,7 @@ public function setCoordinates($latitude, $longitude): self
152152
return $this;
153153
}
154154

155-
public function addAdminLevel(int $level, string $name, string $code = null): self
155+
public function addAdminLevel(int $level, string $name, ?string $code = null): self
156156
{
157157
$this->adminLevels[] = new AdminLevel($level, $name, $code);
158158

‎Model/AddressCollection.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ public function isEmpty(): bool
5959
/**
6060
* @return Location[]
6161
*/
62-
public function slice(int $offset, int $length = null)
62+
public function slice(int $offset, ?int $length = null)
6363
{
6464
return array_slice($this->locations, $offset, $length);
6565
}

‎Model/AdminLevel.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ final class AdminLevel
3232
*/
3333
private $code;
3434

35-
public function __construct(int $level, string $name, string $code = null)
35+
public function __construct(int $level, string $name, ?string $code = null)
3636
{
3737
$this->level = $level;
3838
$this->name = $name;

‎Model/AdminLevelCollection.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ public function first(): AdminLevel
7777
/**
7878
* @return AdminLevel[]
7979
*/
80-
public function slice(int $offset, int $length = null): array
80+
public function slice(int $offset, ?int $length = null): array
8181
{
8282
return array_slice($this->adminLevels, $offset, $length, true);
8383
}

‎Model/Country.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ final class Country
3131
*/
3232
private $code;
3333

34-
public function __construct(string $name = null, string $code = null)
34+
public function __construct(?string $name = null, ?string $code = null)
3535
{
3636
if (null === $name && null === $code) {
3737
throw new InvalidArgument('A country must have either a name or a code');

‎ProviderAggregator.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ class ProviderAggregator implements Geocoder
4545
*/
4646
private $decider;
4747

48-
public function __construct(callable $decider = null, int $limit = Geocoder::DEFAULT_RESULT_LIMIT)
48+
public function __construct(?callable $decider = null, int $limit = Geocoder::DEFAULT_RESULT_LIMIT)
4949
{
5050
$this->limit = $limit;
5151
$this->decider = $decider ?? __CLASS__.'::getProvider';
@@ -134,7 +134,7 @@ public function getProviders(): array
134134
*
135135
* @throws ProviderNotRegistered
136136
*/
137-
private static function getProvider($query, array $providers, Provider $currentProvider = null): Provider
137+
private static function getProvider($query, array $providers, ?Provider $currentProvider = null): Provider
138138
{
139139
if (null !== $currentProvider) {
140140
return $currentProvider;

‎StatefulGeocoder.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ final class StatefulGeocoder implements Geocoder
4242
*/
4343
private $provider;
4444

45-
public function __construct(Provider $provider, string $locale = null)
45+
public function __construct(Provider $provider, ?string $locale = null)
4646
{
4747
$this->provider = $provider;
4848
$this->locale = $locale;

0 commit comments

Comments
 (0)
0