| Total Complexity | 4 |
| Total Lines | 28 |
| Duplicated Lines | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 7 | class Api |
||
| 8 | { |
||
| 9 | use WeatherApiTrait; |
||
| 10 | |||
| 11 | private $di; |
||
| 12 | private $endpoints = []; |
||
| 13 | |||
| 14 | public function __construct(array $endpoints = [], $di = null) |
||
| 18 | } |
||
| 19 | |||
| 20 | public function getServiceByName($name) |
||
| 21 | { |
||
| 22 | return array_key_exists($name, $this->endpoints) |
||
| 23 | ? $this->endpoints[$name] |
||
| 24 | : false; |
||
| 25 | } |
||
| 26 | |||
| 27 | public function fetchCurl($endpoint) |
||
| 35 | } |
||
| 36 | } |
||
| 37 |