This commit is contained in:
Kevin Adametz 2024-08-05 12:05:24 +02:00
parent 04d677d37a
commit bfa3bb1df4
1191 changed files with 637397 additions and 10619 deletions

View file

@ -0,0 +1,55 @@
<?php
namespace App\Services\IPinfo;
/**
* Holds formatted data for a single IP address.
*/
class Details
{
public $country;
public $country_name;
public $country_flag;
public $country_code;
public $country_flag_url;
public $country_currency;
public $continent;
public $latitude;
public $longitude;
public $loc;
public $is_eu;
public $ip;
public $hostname;
public $anycast;
public $city;
public $org;
public $postal;
public $region;
public $timezone;
public $asn;
public $company;
public $privacy;
public $abuse;
public $domains;
public $bogon;
public $all;
public $error;
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);
}
}