| 1 | <?php |
||
| 14 | final class MapsOldGeocoderAdapter extends \Maps\Geocoder { |
||
| 15 | |||
| 16 | private $geocoder; |
||
| 17 | |||
| 18 | /** |
||
| 19 | * @param Geocoder $geocoder |
||
| 20 | * @param string $identifier |
||
| 21 | */ |
||
| 22 | public function __construct( Geocoder $geocoder, $identifier ) { |
||
| 23 | $this->geocoder = $geocoder; |
||
| 24 | |||
| 25 | parent::__construct( $identifier ); |
||
| 26 | } |
||
| 27 | |||
| 28 | public function geocode( $address ) { |
||
| 29 | $result = $this->geocoder->geocode( $address ); |
||
| 30 | |||
| 31 | if ( $result === null ) { |
||
| 32 | return false; |
||
| 33 | } |
||
| 34 | |||
| 35 | return [ |
||
| 36 | 'lat' => $result->getLatitude(), |
||
| 37 | 'lon' => $result->getLongitude(), |
||
| 38 | ]; |
||
| 39 | } |
||
| 40 | |||
| 41 | protected function getRequestUrl( $address ) {} |
||
| 42 | |||
| 43 | protected function parseResponse( $response ) {} |
||
| 44 | |||
| 45 | } |
||
| 46 |