| Total Complexity | 4 |
| Total Lines | 58 |
| Duplicated Lines | 0 % |
| Changes | 2 | ||
| Bugs | 1 | Features | 0 |
| 1 | <?php |
||
| 10 | trait CWMultiResultTrait |
||
| 11 | { |
||
| 12 | /** |
||
| 13 | * @var array Of CurrentWeather objects. |
||
| 14 | */ |
||
| 15 | public $list; |
||
| 16 | |||
| 17 | /** |
||
| 18 | * @var array Hold query parameters for api call. |
||
| 19 | */ |
||
| 20 | protected $params; |
||
| 21 | |||
| 22 | /** |
||
| 23 | * @var string Part of the api link. |
||
| 24 | */ |
||
| 25 | protected $apiCall; |
||
| 26 | |||
| 27 | /** |
||
| 28 | * Return instance of CWMultiResultInterface. |
||
| 29 | */ |
||
| 30 | public function get() |
||
| 40 | } |
||
| 41 | |||
| 42 | /** |
||
| 43 | * Return the $index item on the list as CurrentWeather object. |
||
| 44 | * @param $index |
||
| 45 | * @return CurrentWeather |
||
| 46 | */ |
||
| 47 | public function index($index): CurrentWeather |
||
| 48 | { |
||
| 49 | return $this->list[$index]; |
||
| 50 | } |
||
| 51 | |||
| 52 | /** |
||
| 53 | * Return the first item on the list as CurrentWeather object. |
||
| 54 | * @return CurrentWeather |
||
| 55 | */ |
||
| 56 | public function first(): CurrentWeather |
||
| 59 | } |
||
| 60 | |||
| 61 | /** |
||
| 62 | * Return count number of the result. |
||
| 63 | * @return int |
||
| 64 | */ |
||
| 65 | public function count(): int |
||
| 70 |