| Total Complexity | 3 |
| Total Lines | 45 |
| Duplicated Lines | 0 % |
| Changes | 2 | ||
| Bugs | 1 | Features | 0 |
| 1 | <?php |
||
| 12 | class CWByZipCode extends WeatherFactory implements CWSingleResultInterface |
||
| 13 | { |
||
| 14 | use CWSingleResultTrait; |
||
| 15 | |||
| 16 | /** |
||
| 17 | * @var string Zip code. |
||
| 18 | */ |
||
| 19 | protected $zipCode; |
||
| 20 | |||
| 21 | /** |
||
| 22 | * @var string ISO 3166 country codes. |
||
| 23 | */ |
||
| 24 | protected $countryCode; |
||
| 25 | |||
| 26 | /** |
||
| 27 | * CWByZipCode constructor. |
||
| 28 | * |
||
| 29 | * You can call by zip code. |
||
| 30 | * Please note if countryCode is not specified then the search works for USA as a default. |
||
| 31 | * |
||
| 32 | * @param string $zipCode Zip code. |
||
| 33 | * @param string|null $countryCode ISO 3166 country codes. |
||
| 34 | * @throws \Illuminate\Contracts\Container\BindingResolutionException |
||
| 35 | */ |
||
| 36 | public function __construct(string $zipCode, string $countryCode = 'us') |
||
| 43 | } |
||
| 44 | |||
| 45 | /** |
||
| 46 | * Generate query parameters for api call. |
||
| 47 | * @return array |
||
| 48 | */ |
||
| 49 | private function paramsToArray(): array |
||
| 59 |