1 | <?php |
||
19 | class BurzeDzisNet implements BurzeDzisNetInterface |
||
20 | { |
||
21 | /** |
||
22 | * Soap client |
||
23 | * |
||
24 | * @var \SoapClient Soap client |
||
25 | */ |
||
26 | private $client = null; |
||
27 | |||
28 | /** |
||
29 | * API key |
||
30 | * |
||
31 | * @var string API key |
||
32 | */ |
||
33 | private $apiKey = null; |
||
34 | |||
35 | /** |
||
36 | * Remote client |
||
37 | * |
||
38 | * @param EndpointInterface $endpoint entry point to burze.dzis.net |
||
39 | */ |
||
40 | public function __construct(EndpointInterface $endpoint) |
||
45 | |||
46 | /** |
||
47 | * Indicates whether given API key is valid |
||
48 | * |
||
49 | * @param string $apiKey API key |
||
50 | * @return bool true if API key is valid; otherwise false |
||
51 | * @throws \SoapFault soap error |
||
52 | */ |
||
53 | public function verifyApiKey(string $apiKey): bool |
||
57 | |||
58 | /** |
||
59 | * Get Point representing location coordinates |
||
60 | * |
||
61 | * If no location returns Point with coordinates [0,0]. |
||
62 | * |
||
63 | * @see Point |
||
64 | * @param string $name location name |
||
65 | * @return Point location coordinates |
||
66 | * @throws \SoapFault soap error |
||
67 | */ |
||
68 | public function locate(string $name): Point |
||
76 | |||
77 | /** |
||
78 | * Get information about storm for the given locality and monitoring radius |
||
79 | * |
||
80 | * @see Storm |
||
81 | * @param Point $point monitored location |
||
82 | * @param int $radius radius of monitoring |
||
83 | * @return Storm information about registered lightnings and more |
||
84 | * @throws \SoapFault soap error |
||
85 | */ |
||
86 | public function getStorm(Point $point, int $radius = 25): Storm |
||
102 | |||
103 | /** |
||
104 | * Get set of weather alerts for the given Point |
||
105 | * |
||
106 | * <strong>Only Polish area</strong> |
||
107 | * @param Point $point location coordinates |
||
108 | * @return WeatherAlert set of weather alerts |
||
109 | */ |
||
110 | public function getWeatherAlert(Point $point): WeatherAlert |
||
162 | } |
||
163 |