1 | <?php |
||
13 | class EveOnline extends AbstractProvider |
||
14 | { |
||
15 | use BearerAuthorizationTrait; |
||
16 | |||
17 | |||
18 | /** |
||
19 | * Default scopes |
||
20 | * |
||
21 | * @var array |
||
22 | */ |
||
23 | public $defaultScopes = []; |
||
24 | |||
25 | /** |
||
26 | * Get the string used to separate scopes. |
||
27 | * |
||
28 | * @return string |
||
29 | 9 | */ |
|
30 | protected function getScopeSeparator() |
||
34 | |||
35 | /** |
||
36 | * Returns the base URL for authorizing a client. |
||
37 | * |
||
38 | * Eg. https://oauth.service.com/authorize |
||
39 | * |
||
40 | * @return string |
||
41 | 9 | */ |
|
42 | public function getBaseAuthorizationUrl() |
||
46 | |||
47 | /** |
||
48 | * Returns the base URL for requesting an access token. |
||
49 | * |
||
50 | * Eg. https://oauth.service.com/token |
||
51 | * |
||
52 | * @param array $params |
||
53 | * @return string |
||
54 | 21 | */ |
|
55 | public function getBaseAccessTokenUrl(array $params) |
||
59 | |||
60 | /** |
||
61 | * Returns the URL for requesting the resource owner's details. |
||
62 | * |
||
63 | * @param AccessToken $token |
||
64 | * @return string |
||
65 | 3 | */ |
|
66 | public function getResourceOwnerDetailsUrl(AccessToken $token) |
||
70 | |||
71 | /** |
||
72 | * Returns the default scopes used by this provider. |
||
73 | * |
||
74 | * This should only be the scopes that are required to request the details |
||
75 | * of the resource owner, rather than all the available scopes. |
||
76 | * |
||
77 | * @return array |
||
78 | 6 | */ |
|
79 | protected function getDefaultScopes() |
||
83 | |||
84 | /** |
||
85 | * Checks a provider response for errors. |
||
86 | * |
||
87 | * @throws IdentityProviderException |
||
88 | * @param ResponseInterface $response |
||
89 | * @param array|string $data Parsed response data |
||
90 | * @return void |
||
91 | 21 | */ |
|
92 | protected function checkResponse(ResponseInterface $response, $data) |
||
106 | |||
107 | /** |
||
108 | * Generates a resource owner object from a successful resource owner |
||
109 | * details request. |
||
110 | * |
||
111 | * @param array $response |
||
112 | * @param AccessToken $token |
||
113 | * @return ResourceOwnerInterface |
||
114 | 3 | */ |
|
115 | protected function createResourceOwner(array $response, AccessToken $token) |
||
119 | |||
120 | /** |
||
121 | * Parses the response according to its content-type header. |
||
122 | * |
||
123 | * @throws UnexpectedValueException |
||
124 | * @param ResponseInterface $response |
||
125 | 9 | * @return array |
|
126 | */ |
||
127 | 9 | protected function parseResponse(ResponseInterface $response) |
|
155 | |||
156 | /** |
||
157 | * Internal helper function to safe read from an array |
||
158 | * @param mixed $array |
||
159 | * @param string|int $key |
||
160 | * @return null |
||
161 | */ |
||
162 | private function safeRead($array, $key) |
||
166 | } |
||
167 |
If a method or function can return multiple different values and unless you are sure that you only can receive a single value in this context, we recommend to add an additional type check:
If this a common case that PHP Analyzer should handle natively, please let us know by opening an issue.