1 | <?php |
||
12 | final class NetAcuity implements NetAcuityInterface |
||
13 | { |
||
14 | /** |
||
15 | * @var NetAcuityDatabaseInterface The Net Acuity Database to fetch data from. |
||
16 | */ |
||
17 | private $database; |
||
18 | |||
19 | /** |
||
20 | * Create the NetAcuity client. |
||
21 | * |
||
22 | * @param NetAcuityDatabaseInterface $database The Net Acuity Database to be used. |
||
23 | * |
||
24 | * @throws Exception |
||
25 | */ |
||
26 | public function __construct(NetAcuityDatabaseInterface $database) |
||
30 | |||
31 | /** |
||
32 | * Gets the geo data for the given IP. |
||
33 | * |
||
34 | * Failures will be raised as exceptions. |
||
35 | * |
||
36 | * @param string $ip The ip address to lookup |
||
37 | * |
||
38 | * @return array { |
||
39 | * @type string $country |
||
40 | * @type string $region |
||
41 | * @type string $city |
||
42 | * @type string $conn-speed |
||
43 | * @type string $metro-code |
||
44 | * @type string $latitude |
||
45 | * @type string $longitude |
||
46 | * @type string $postal-code |
||
47 | * @type string $country-code |
||
48 | * @type string $region-code |
||
49 | * @type string $city-code |
||
50 | * @type string $continent-code |
||
51 | * @type string $two-letter-country |
||
52 | * @type string $area-code |
||
53 | * @type string $country-conf |
||
54 | * @type string $region-conf |
||
55 | * @type string $city-conf |
||
56 | * @type string $postal-conf |
||
57 | * @type string $gmt-offset |
||
58 | * @type string $in-dist |
||
59 | * @type string $timezone-name |
||
60 | * } |
||
61 | */ |
||
62 | public function getGeo(string $ip) : array |
||
67 | } |
||
68 |