Total Complexity | 4 |
Total Lines | 36 |
Duplicated Lines | 0 % |
Coverage | 100% |
Changes | 2 | ||
Bugs | 1 | Features | 0 |
1 | <?php |
||
7 | class Coordinates |
||
8 | { |
||
9 | private $geocoder; |
||
10 | |||
11 | /** |
||
12 | * Constructor, allow for $geocoder to be injected. |
||
13 | * |
||
14 | * @param AbstractGeocoder $geocoder a service that fetches coordinates from a query |
||
15 | * |
||
16 | * @return string "latitude,longitude" for example 56.0505,124.100101 |
||
17 | */ |
||
18 | 2 | public function __construct(AbstractGeocoder $geocoder) |
|
21 | 2 | } |
|
22 | |||
23 | /** |
||
24 | * This method checks if a input is a valid lat long |
||
25 | * If not it does a search on it and returns the answer. |
||
26 | * |
||
27 | * @param string $value |
||
28 | * |
||
29 | * @return string |
||
30 | */ |
||
31 | 2 | public function getCoordinates(String $search) : String |
|
45 |