1 | <?php |
||
12 | class EveOnline extends AbstractProvider |
||
13 | { |
||
14 | use BearerAuthorizationTrait; |
||
15 | |||
16 | |||
17 | /** |
||
18 | * Default scopes |
||
19 | * |
||
20 | * @var array |
||
21 | */ |
||
22 | public $defaultScopes = []; |
||
23 | |||
24 | /** |
||
25 | * Get the string used to separate scopes. |
||
26 | * |
||
27 | * @return string |
||
28 | */ |
||
29 | 9 | protected function getScopeSeparator() |
|
33 | |||
34 | /** |
||
35 | * Returns the base URL for authorizing a client. |
||
36 | * |
||
37 | * Eg. https://oauth.service.com/authorize |
||
38 | * |
||
39 | * @return string |
||
40 | */ |
||
41 | 9 | public function getBaseAuthorizationUrl() |
|
45 | |||
46 | /** |
||
47 | * Returns the base URL for requesting an access token. |
||
48 | * |
||
49 | * Eg. https://oauth.service.com/token |
||
50 | * |
||
51 | * @param array $params |
||
52 | * @return string |
||
53 | */ |
||
54 | 21 | public function getBaseAccessTokenUrl(array $params) |
|
58 | |||
59 | /** |
||
60 | * Returns the URL for requesting the resource owner's details. |
||
61 | * |
||
62 | * @param AccessToken $token |
||
63 | * @return string |
||
64 | */ |
||
65 | 3 | public function getResourceOwnerDetailsUrl(AccessToken $token) |
|
69 | |||
70 | /** |
||
71 | * Returns the default scopes used by this provider. |
||
72 | * |
||
73 | * This should only be the scopes that are required to request the details |
||
74 | * of the resource owner, rather than all the available scopes. |
||
75 | * |
||
76 | * @return array |
||
77 | */ |
||
78 | 6 | protected function getDefaultScopes() |
|
82 | |||
83 | /** |
||
84 | * Checks a provider response for errors. |
||
85 | * |
||
86 | * @throws IdentityProviderException |
||
87 | * @param ResponseInterface $response |
||
88 | * @param array|string $data Parsed response data |
||
89 | * @return void |
||
90 | */ |
||
91 | 21 | protected function checkResponse(ResponseInterface $response, $data) |
|
105 | |||
106 | /** |
||
107 | * Generates a resource owner object from a successful resource owner |
||
108 | * details request. |
||
109 | * |
||
110 | * @param array $response |
||
111 | * @param AccessToken $token |
||
112 | * @return ResourceOwnerInterface |
||
113 | */ |
||
114 | 3 | protected function createResourceOwner(array $response, AccessToken $token) |
|
118 | |||
119 | /** |
||
120 | * Internal helper function to safe read from an array |
||
121 | * @param mixed $array |
||
122 | * @param string|int $key |
||
123 | * @return null |
||
124 | */ |
||
125 | 9 | private function safeRead($array, $key) |
|
129 | } |
||
130 |
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.