1 | <?php |
||
9 | class Geocoder { |
||
10 | |||
11 | /** |
||
12 | * @var string |
||
13 | */ |
||
14 | protected $_api_key; |
||
15 | |||
16 | /** |
||
17 | * @var HTTP |
||
18 | */ |
||
19 | protected $_http; |
||
20 | |||
21 | /** |
||
22 | * Geocoder constructor. |
||
23 | * |
||
24 | * @param array $args |
||
25 | */ |
||
26 | 1 | public function __construct( $args = array() ) { |
|
37 | |||
38 | /** |
||
39 | * @return string |
||
40 | */ |
||
41 | 1 | public function api_key() { |
|
46 | |||
47 | /** |
||
48 | * @param string $address |
||
49 | * @return Location|\WP_Error |
||
50 | */ |
||
51 | 3 | public function geocode( $address ) { |
|
76 | |||
77 | /** |
||
78 | * @param string $address |
||
79 | * @return string |
||
80 | */ |
||
81 | 2 | private function _make_url( $address ) { |
|
90 | |||
91 | /** |
||
92 | * Convert the response body into an a Location object |
||
93 | * |
||
94 | * @param array $results |
||
95 | * @return Location |
||
96 | */ |
||
97 | 2 | private function _make_location( $results ) { |
|
114 | |||
115 | /** |
||
116 | * @param array $results |
||
117 | * @return string |
||
118 | */ |
||
119 | 1 | private function _get_state_from_results( $results ) { |
|
124 | |||
125 | /** |
||
126 | * @param array $results |
||
127 | * @return string |
||
128 | */ |
||
129 | 1 | private function _get_zip_from_results( $results ) { |
|
134 | |||
135 | /** |
||
136 | * @param string $value |
||
137 | * @param array $results |
||
138 | * @return string |
||
139 | */ |
||
140 | 2 | private function _get_value_from_results( $value, $results ) { |
|
156 | |||
157 | } |
||
158 |