1 | <?php |
||
9 | class Geocoder { |
||
10 | |||
11 | /** |
||
12 | * @var string |
||
13 | */ |
||
14 | protected $_api_key; |
||
15 | |||
16 | /** |
||
17 | * KSA_Geocoder constructor. |
||
18 | * |
||
19 | * @param array $args |
||
20 | */ |
||
21 | function __construct( $args = array() ) { |
||
30 | |||
31 | /** |
||
32 | * @return string |
||
33 | */ |
||
34 | function api_key() { |
||
39 | |||
40 | /** |
||
41 | * @param string $address |
||
42 | * @return Location|\WP_Error |
||
43 | */ |
||
44 | function geocode( $address ) { |
||
53 | |||
54 | /** |
||
55 | * @param string $address |
||
56 | * @return string |
||
57 | */ |
||
58 | private function _make_url( $address ) { |
||
67 | |||
68 | /** |
||
69 | * Convert the response body into an a Location object |
||
70 | * |
||
71 | * @param array $response |
||
72 | * @return Location |
||
73 | */ |
||
74 | private function _make_location( $response ) { |
||
87 | |||
88 | |||
89 | /** |
||
90 | * @param $url |
||
91 | * @return array|\WP_Error |
||
92 | */ |
||
93 | private function _make_request( $url ) { |
||
111 | |||
112 | /** |
||
113 | * @param $url |
||
114 | * @return array|\WP_Error |
||
115 | */ |
||
116 | private function _get_data( $url ) { |
||
128 | |||
129 | } |
||
130 |