Total Complexity | 8 |
Total Lines | 48 |
Duplicated Lines | 0 % |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
9 | class Mock extends AbstractService |
||
10 | { |
||
11 | const SCOPE_MOCK = 'mock'; |
||
12 | const SCOPE_MOCK_2 = 'mock2'; |
||
13 | |||
14 | private $authorizationMethod; |
||
15 | |||
16 | public function getAuthorizationEndpoint() |
||
17 | { |
||
18 | return new Uri('http://pieterhordijk.com/auth'); |
||
19 | } |
||
20 | |||
21 | public function getAccessTokenEndpoint() |
||
22 | { |
||
23 | return new Uri('http://pieterhordijk.com/access'); |
||
24 | } |
||
25 | |||
26 | protected function parseAccessTokenResponse($responseBody) |
||
27 | { |
||
28 | return new StdOAuth2Token(); |
||
29 | } |
||
30 | |||
31 | // this allows us to set different auth methods for tests |
||
32 | public function setAuthorizationMethod($method): void |
||
33 | { |
||
34 | $this->authorizationMethod = $method; |
||
35 | } |
||
36 | |||
37 | /** |
||
38 | * Returns a class constant from ServiceInterface defining the authorization method used for the API |
||
39 | * Header is the sane default. |
||
40 | * |
||
41 | * @return int |
||
42 | */ |
||
43 | protected function getAuthorizationMethod() |
||
57 | } |
||
58 | } |
||
59 |