1 | <?php |
||
18 | class Extractor implements ExtractorInterface |
||
19 | { |
||
20 | /** |
||
21 | * @var \OAuth\Common\Service\ServiceInterface $service |
||
22 | */ |
||
23 | protected $service; |
||
24 | |||
25 | /** |
||
26 | * Array of supported fields |
||
27 | * @var array $supports |
||
28 | */ |
||
29 | protected $supports; |
||
30 | |||
31 | /** |
||
32 | * Associative array with all the fields value |
||
33 | * @var array |
||
34 | */ |
||
35 | protected $fields; |
||
36 | |||
37 | /** |
||
38 | * Constructor |
||
39 | * |
||
40 | * @param array $supports |
||
41 | * @param array $fields |
||
42 | */ |
||
43 | public function __construct($supports = array(), $fields = array()) |
||
48 | |||
49 | /** |
||
50 | * {@inheritDoc} |
||
51 | */ |
||
52 | public function supportsUniqueId() |
||
56 | |||
57 | /** |
||
58 | * {@inheritDoc} |
||
59 | */ |
||
60 | public function getUniqueId() |
||
64 | |||
65 | /** |
||
66 | * {@inheritDoc} |
||
67 | */ |
||
68 | public function supportsUsername() |
||
72 | |||
73 | /** |
||
74 | * {@inheritDoc} |
||
75 | */ |
||
76 | public function getUsername() |
||
80 | |||
81 | /** |
||
82 | * {@inheritDoc} |
||
83 | */ |
||
84 | public function supportsFirstName() |
||
88 | |||
89 | /** |
||
90 | * {@inheritDoc} |
||
91 | */ |
||
92 | public function getFirstName() |
||
96 | |||
97 | /** |
||
98 | * {@inheritDoc} |
||
99 | */ |
||
100 | public function supportsLastName() |
||
104 | |||
105 | /** |
||
106 | * {@inheritDoc} |
||
107 | */ |
||
108 | public function getLastName() |
||
112 | |||
113 | /** |
||
114 | * {@inheritDoc} |
||
115 | */ |
||
116 | public function supportsFullName() |
||
120 | |||
121 | /** |
||
122 | * {@inheritDoc} |
||
123 | */ |
||
124 | public function getFullName() |
||
128 | |||
129 | /** |
||
130 | * {@inheritDoc} |
||
131 | */ |
||
132 | public function supportsEmail() |
||
136 | |||
137 | /** |
||
138 | * {@inheritDoc} |
||
139 | */ |
||
140 | public function getEmail() |
||
144 | |||
145 | /** |
||
146 | * {@inheritDoc} |
||
147 | */ |
||
148 | public function supportsLocation() |
||
152 | |||
153 | /** |
||
154 | * {@inheritDoc} |
||
155 | */ |
||
156 | public function getLocation() |
||
160 | |||
161 | /** |
||
162 | * {@inheritDoc} |
||
163 | */ |
||
164 | public function supportsDescription() |
||
168 | |||
169 | /** |
||
170 | * {@inheritDoc} |
||
171 | */ |
||
172 | public function getDescription() |
||
176 | |||
177 | /** |
||
178 | * {@inheritDoc} |
||
179 | */ |
||
180 | public function supportsImageUrl() |
||
184 | |||
185 | /** |
||
186 | * {@inheritDoc} |
||
187 | */ |
||
188 | public function getImageUrl() |
||
192 | |||
193 | /** |
||
194 | * {@inheritDoc} |
||
195 | */ |
||
196 | public function supportsProfileUrl() |
||
200 | |||
201 | /** |
||
202 | * {@inheritDoc} |
||
203 | */ |
||
204 | public function getProfileUrl() |
||
208 | |||
209 | /** |
||
210 | * {@inheritDoc} |
||
211 | */ |
||
212 | public function supportsWebsites() |
||
216 | |||
217 | /** |
||
218 | * {@inheritDoc} |
||
219 | */ |
||
220 | public function getWebsites() |
||
224 | |||
225 | /** |
||
226 | * {@inheritDoc} |
||
227 | */ |
||
228 | public function supportsVerifiedEmail() |
||
232 | |||
233 | /** |
||
234 | * {@inheritDoc} |
||
235 | */ |
||
236 | public function isEmailVerified() |
||
240 | |||
241 | /** |
||
242 | * {@inheritDoc} |
||
243 | */ |
||
244 | public function supportsExtra() |
||
248 | |||
249 | /** |
||
250 | * {@inheritDoc} |
||
251 | */ |
||
252 | public function getExtra($key) |
||
258 | |||
259 | /** |
||
260 | * {@inheritDoc} |
||
261 | */ |
||
262 | public function getExtras() |
||
266 | |||
267 | /** |
||
268 | * {@inheritDoc} |
||
269 | */ |
||
270 | public function setService($service) |
||
274 | |||
275 | /** |
||
276 | * Get the value for a given field |
||
277 | * |
||
278 | * @param string $field the name of the field |
||
279 | * @return null|mixed |
||
280 | */ |
||
281 | protected function getField($field) |
||
289 | |||
290 | /** |
||
291 | * Check if a given field is supported |
||
292 | * |
||
293 | * @param string $field the name of the field |
||
294 | * @return bool |
||
295 | */ |
||
296 | protected function isFieldSupported($field) |
||
300 | |||
301 | /** |
||
302 | * Get an array listing all fields names |
||
303 | * |
||
304 | * @return string[] |
||
305 | */ |
||
306 | protected static function getAllFields() |
||
324 | } |
||
325 |