Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions src/Details.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
/**
* Holds formatted data for a single IP address.
*/
#[\AllowDynamicProperties]
class Details
{
public $country;
Expand Down
1 change: 1 addition & 0 deletions src/DetailsCore.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
/**
* Holds formatted data received from Core API for a single IP address.
*/
#[\AllowDynamicProperties]
class DetailsCore
{
public $ip;
Expand Down
1 change: 1 addition & 0 deletions src/DetailsLite.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
/**
* Holds formatted data received from Lite API for a single IP address.
*/
#[\AllowDynamicProperties]
class DetailsLite
{
public $ip;
Expand Down
1 change: 1 addition & 0 deletions src/DetailsPlus.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
/**
* Holds formatted data received from Plus API for a single IP address.
*/
#[\AllowDynamicProperties]
class DetailsPlus
{
public $ip;
Expand Down
18 changes: 9 additions & 9 deletions tests/IPinfoTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -207,15 +207,15 @@ public function testGetBatchDetails()
$this->assertArrayHasKey('9.9.9.9', $res);
$this->assertArrayHasKey('10.10.10.10', $res);
$this->assertEquals($res['8.8.8.8/hostname'], 'dns.google');
$ipV4 = $res['4.4.4.4'];
$this->assertEquals($ipV4['ip'], '4.4.4.4');
$ipV4 = $res['1.1.1.1'];
$this->assertEquals($ipV4['ip'], '1.1.1.1');
$this->assertNotNull($ipV4['city']);
$this->assertNotNull($ipV4['region']);
$this->assertNotNull($ipV4['country']);
$this->assertNotNull($ipV4['loc']);
$this->assertNotNull($ipV4['postal']);
$this->assertNotNull($ipV4['timezone']);
$this->assertEquals($ipV4['org'], 'AS3356 Level 3 Parent, LLC');
$this->assertNotNull($ipV4['org']);
}
}

Expand Down Expand Up @@ -276,12 +276,12 @@ public function testIpv6Details()
for ($i = 0; $i < 5; $i++) {
$res = $h->getDetails($ip);
$this->assertEquals($res->ip, '2607:f8b0:4005:805::200e');
$this->assertEquals($res->city, 'San Jose');
$this->assertEquals($res->region, 'California');
$this->assertEquals($res->country, 'US');
$this->assertEquals($res->loc, '37.3394,-121.8950');
$this->assertEquals($res->postal, '95025');
$this->assertEquals($res->timezone, 'America/Los_Angeles');
$this->assertNotNull($res->city);
$this->assertNotNull($res->region);
$this->assertNotNull($res->country);
$this->assertNotNull($res->loc);
$this->assertNotNull($res->postal);
$this->assertNotNull($res->timezone);
}
}

Expand Down
Loading