We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent f1e4dd5 commit 7147850Copy full SHA for 7147850
Collection.php
@@ -35,7 +35,7 @@ public function isEmpty(): bool;
35
/**
36
* @return Location[]
37
*/
38
- public function slice(int $offset, int $length = null);
+ public function slice(int $offset, ?int $length = null);
39
40
public function has(int $index): bool;
41
Geocoder.php
@@ -34,14 +34,14 @@ interface Geocoder extends Provider
34
* Geocodes a given value.
*
- * @throws \Geocoder\Exception\Exception
+ * @throws Exception\Exception
public function geocode(string $value): Collection;
42
* Reverses geocode given latitude and longitude values.
43
44
45
46
public function reverse(float $latitude, float $longitude): Collection;
47
}
Model/Address.php
@@ -77,15 +77,15 @@ class Address implements Location
77
final public function __construct(
78
string $providedBy,
79
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
+ ?Coordinates $coordinates = null,
+ ?Bounds $bounds = null,
+ ?string $streetNumber = null,
+ ?string $streetName = null,
+ ?string $postalCode = null,
+ ?string $locality = null,
+ ?string $subLocality = null,
+ ?Country $country = null,
+ ?string $timezone = null
89
) {
90
$this->providedBy = $providedBy;
91
$this->adminLevels = $adminLevels;
Model/AddressBuilder.php
@@ -152,7 +152,7 @@ public function setCoordinates($latitude, $longitude): self
152
return $this;
153
154
155
- public function addAdminLevel(int $level, string $name, string $code = null): self
+ public function addAdminLevel(int $level, string $name, ?string $code = null): self
156
{
157
$this->adminLevels[] = new AdminLevel($level, $name, $code);
158
Model/AddressCollection.php
@@ -59,7 +59,7 @@ public function isEmpty(): bool
59
60
61
62
- public function slice(int $offset, int $length = null)
+ public function slice(int $offset, ?int $length = null)
63
64
return array_slice($this->locations, $offset, $length);
65
Model/AdminLevel.php
@@ -32,7 +32,7 @@ final class AdminLevel
32
33
private $code;
- public function __construct(int $level, string $name, string $code = null)
+ public function __construct(int $level, string $name, ?string $code = null)
$this->level = $level;
$this->name = $name;
Model/AdminLevelCollection.php
@@ -77,7 +77,7 @@ public function first(): AdminLevel
* @return AdminLevel[]
- public function slice(int $offset, int $length = null): array
+ public function slice(int $offset, ?int $length = null): array
return array_slice($this->adminLevels, $offset, $length, true);
Model/Country.php
@@ -31,7 +31,7 @@ final class Country
31
- public function __construct(string $name = null, string $code = null)
+ public function __construct(?string $name = null, ?string $code = null)
if (null === $name && null === $code) {
throw new InvalidArgument('A country must have either a name or a code');
ProviderAggregator.php
@@ -45,7 +45,7 @@ class ProviderAggregator implements Geocoder
private $decider;
48
- public function __construct(callable $decider = null, int $limit = Geocoder::DEFAULT_RESULT_LIMIT)
+ public function __construct(?callable $decider = null, int $limit = Geocoder::DEFAULT_RESULT_LIMIT)
49
50
$this->limit = $limit;
51
$this->decider = $decider ?? __CLASS__.'::getProvider';
@@ -134,7 +134,7 @@ public function getProviders(): array
134
135
* @throws ProviderNotRegistered
136
137
- private static function getProvider($query, array $providers, Provider $currentProvider = null): Provider
+ private static function getProvider($query, array $providers, ?Provider $currentProvider = null): Provider
138
139
if (null !== $currentProvider) {
140
return $currentProvider;
StatefulGeocoder.php
@@ -42,7 +42,7 @@ final class StatefulGeocoder implements Geocoder
private $provider;
- public function __construct(Provider $provider, string $locale = null)
+ public function __construct(Provider $provider, ?string $locale = null)
$this->provider = $provider;
$this->locale = $locale;
0 commit comments