Skip to content

Commit

Permalink
Merge pull request #188 from onlime/php84-deprecations
Browse files Browse the repository at this point in the history
PHP 8.4 deprecations
  • Loading branch information
stevebauman authored Dec 8, 2024
2 parents 6900612 + e380acf commit b48fe8d
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion src/LocationFake.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ public function __call(string $method, array $parameters): mixed
/**
* Get a fake location instance.
*/
public function get(string $ip = null): Position|bool
public function get(?string $ip = null): Position|bool
{
$ip ??= '127.0.0.1';

Expand Down
2 changes: 1 addition & 1 deletion src/LocationManager.php
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ public function setDefaultDriver(): static
/**
* Attempt to retrieve the location of the user.
*/
public function get(string $ip = null): Position|bool
public function get(?string $ip = null): Position|bool
{
if ($location = $this->driver->get($this->request()->setIp($ip))) {
return $location;
Expand Down
4 changes: 2 additions & 2 deletions src/LocationRequest.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ public function getIp(): string
/**
* Set the IP address to resolve.
*/
public function setIp(string $ip = null): static
public function setIp(?string $ip = null): static
{
$this->ip = $ip;

Expand All @@ -40,7 +40,7 @@ public function setIp(string $ip = null): static
/**
* Get a header from the request.
*/
public function getHeader(string $key = null, string|array $default = null): string|array|null
public function getHeader(?string $key = null, string|array|null $default = null): string|array|null
{
return parent::header($key, $default);
}
Expand Down
4 changes: 2 additions & 2 deletions src/Request.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,10 @@ public function getIp(): string;
/**
* Set the IP address to resolve.
*/
public function setIp(string $ip = null): static;
public function setIp(?string $ip = null): static;

/**
* Get a header from the request.
*/
public function getHeader(string $key = null, string|array $default = null): string|array|null;
public function getHeader(?string $key = null, string|array|null $default = null): string|array|null;
}

0 comments on commit b48fe8d

Please sign in to comment.