-
Notifications
You must be signed in to change notification settings - Fork 87
Expand file tree
/
Copy pathDetailsLite.php
More file actions
43 lines (39 loc) · 942 Bytes
/
DetailsLite.php
File metadata and controls
43 lines (39 loc) · 942 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
<?php
namespace ipinfo\ipinfo;
/**
* Holds formatted data received from Lite API for a single IP address.
*/
class DetailsLite
{
public $ip;
public $asn;
public $as_name;
public $as_domain;
public $country_code;
public $country;
public $continent_code;
public $continent;
public $country_name;
public $is_eu;
public $country_flag;
public $country_flag_url;
public $country_currency;
public $bogon;
public $all;
public function __construct($raw_details)
{
foreach ($raw_details as $property => $value) {
$this->$property = $value;
}
$this->all = $raw_details;
}
/**
* Returns json string representation.
*
* @internal this class should implement Stringable explicitly when leaving support for PHP verision < 8.0
*/
public function __toString(): string
{
return json_encode($this);
}
}