Skip to content

Commit

Permalink
#42 Fix type issue
Browse files Browse the repository at this point in the history
  • Loading branch information
alies-dev committed Jan 16, 2025
1 parent 397fff7 commit ff0f7f0
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
1 change: 0 additions & 1 deletion psalm-baseline.xml
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,6 @@
<code><![CDATA[\InteractionDesignFoundation\GeoIP\Contracts\ServiceInterface]]></code>
</MoreSpecificReturnType>
<PossiblyNullArgument>
<code><![CDATA[$ip]]></code>
<code><![CDATA[$location->iso_code]]></code>
<code><![CDATA[$this->currencies]]></code>
</PossiblyNullArgument>
Expand Down
7 changes: 6 additions & 1 deletion src/GeoIP.php
Original file line number Diff line number Diff line change
Expand Up @@ -269,9 +269,14 @@ private function isValid($ip): bool
* @param string|null $ip
*
* @return bool
* @psalm-assert-if-true string $ip
*/
private function shouldCache(Location $location, $ip = null): bool
private function shouldCache(Location $location, ?string $ip = null): bool
{
if ($ip === null) {
return false;
}

if ($location->default === true || $location->cached === true) {
return false;
}
Expand Down

0 comments on commit ff0f7f0

Please sign in to comment.