1 | <?php |
||
20 | class TimezoneDb extends AbstractHttpProvider |
||
21 | { |
||
22 | const ENDPOINT = 'https://api.timezonedb.com/'; |
||
23 | const VIP_ENDPOINT = 'https://vip.timezonedb.com/'; |
||
24 | const FAIL = 'FAIL'; |
||
25 | const SUCCESS = 'OK'; |
||
26 | |||
27 | /** |
||
28 | * @var string |
||
29 | */ |
||
30 | private $apiKey; |
||
31 | |||
32 | /** |
||
33 | * @var string |
||
34 | */ |
||
35 | private $host; |
||
36 | |||
37 | /** |
||
38 | * TimeZoneDB Constructor. |
||
39 | * |
||
40 | * @param string $apiKey |
||
41 | * @param bool $premium |
||
42 | * @param HttpClient $client |
||
43 | * @param MessageFactory $messageFactory |
||
44 | */ |
||
45 | public function __construct( |
||
56 | |||
57 | /** |
||
58 | * Returns the name of this Provider. |
||
59 | * |
||
60 | * @return string |
||
61 | */ |
||
62 | public function getName() |
||
66 | |||
67 | /** |
||
68 | * Returns ZoneInfo for the specified location and timestamp. |
||
69 | * |
||
70 | * @param string|float $lat Coordinate latitude. |
||
71 | * @param string|float $lng Coordinate longitude. |
||
72 | * @param int $timestamp UNIX timestamp used to determine Daylight Savings Time. |
||
73 | * |
||
74 | * @return ZoneInfo |
||
75 | */ |
||
76 | public function find($lat, $lng, $timestamp = null) |
||
86 | |||
87 | /** |
||
88 | * Returns the URI for the specified location and timestamp. |
||
89 | * |
||
90 | * @param string|float $lat Coordinate latitude. |
||
91 | * @param string|float $lng Coordinate longitude. |
||
92 | * @param int|null $timestamp Seconds since Jan 1, 1970 UTC. |
||
93 | * |
||
94 | * @return string |
||
95 | */ |
||
96 | protected function buildUri($lat, $lng, $timestamp = null) |
||
111 | } |
||
112 |