Skip to content

Commit 6e60fd8

Browse files
committed
Improve PHPDoc and add some missing type info
1 parent 6892494 commit 6e60fd8

File tree

4 files changed

+9
-4
lines changed

4 files changed

+9
-4
lines changed

src/Facades/GeoIP.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,9 @@
77
use Illuminate\Support\Facades\Facade;
88

99
/**
10+
* @method static \InteractionDesignFoundation\GeoIP\Location getLocation(string|null $ip)
11+
* @method static string getCurrency(string $iso)
12+
* @method static \InteractionDesignFoundation\GeoIP\Contracts\ServiceInterface getService()
1013
* @mixin \InteractionDesignFoundation\GeoIP\GeoIP
1114
*/
1215
class GeoIP extends Facade

src/GeoIP.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,7 @@ public function getLocation($ip = null)
133133
* @return \InteractionDesignFoundation\GeoIP\Location
134134
* @throws \Exception
135135
*/
136-
private function find($ip = null)
136+
private function find($ip = null): Location
137137
{
138138
// If IP not set, user remote IP
139139
$ip = $ip ?: $this->remote_ip;

src/Location.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@
2525
* @property string|null $currency
2626
* @property bool $default
2727
* @property bool $cached
28+
* @property-read string $displayName {@see static::getDisplayNameAttribute()}
2829
*/
2930
class Location implements ArrayAccess
3031
{

src/helpers.php

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,14 @@
66
/**
77
* Get the location of the provided IP.
88
*
9-
* @param string $ip
10-
*
9+
* @param string|null $ip
1110
* @return \InteractionDesignFoundation\GeoIP\GeoIP|\InteractionDesignFoundation\GeoIP\Location
11+
* @psalm-return ($ip is null ? \InteractionDesignFoundation\GeoIP\GeoIP : \InteractionDesignFoundation\GeoIP\Location)
12+
* @throws \Exception
1213
*/
1314
function geoip($ip = null)
1415
{
15-
if (is_null($ip)) {
16+
if ($ip === null) {
1617
return app('geoip');
1718
}
1819

0 commit comments

Comments
 (0)