1 | <?php |
||
11 | class NextEngineProvider extends AbstractProvider |
||
12 | { |
||
13 | /** |
||
14 | * @var string Key used in a token response to identify the resource owner. |
||
15 | */ |
||
16 | const ACCESS_TOKEN_RESOURCE_OWNER_ID = 'uid'; |
||
17 | |||
18 | /** |
||
19 | 1 | * Returns the base URL for authorizing a client. |
|
20 | * |
||
21 | 1 | * @return string |
|
22 | */ |
||
23 | public function getBaseAuthorizationUrl() |
||
27 | |||
28 | /** |
||
29 | * Returns the base URL for requesting an access token. |
||
30 | 1 | * |
|
31 | * Eg. https://oauth.service.com/token |
||
32 | 1 | * |
|
33 | 1 | * @param array $params |
|
34 | 1 | * @return string |
|
35 | */ |
||
36 | 1 | public function getBaseAccessTokenUrl(array $params) |
|
40 | |||
41 | /** |
||
42 | * Returns the URL for requesting the resource owner's details. |
||
43 | * |
||
44 | * @param AccessToken $token |
||
45 | * @return string |
||
46 | */ |
||
47 | public function getResourceOwnerDetailsUrl(AccessToken $token) |
||
51 | |||
52 | /** |
||
53 | * Returns the default scopes used by this provider. |
||
54 | * |
||
55 | * This should only be the scopes that are required to request the details |
||
56 | * of the resource owner, rather than all the available scopes. |
||
57 | * |
||
58 | * @return string[] |
||
59 | 1 | */ |
|
60 | protected function getDefaultScopes() |
||
64 | |||
65 | 1 | /** |
|
66 | * Checks a provider response for errors. |
||
67 | * |
||
68 | * @throws IdentityProviderException |
||
69 | * @param ResponseInterface $response |
||
70 | * @param array|string $data Parsed response data |
||
71 | * @return void |
||
72 | */ |
||
73 | protected function checkResponse(ResponseInterface $response, $data) |
||
83 | |||
84 | /** |
||
85 | * Returns authorization parameters based on provided options. |
||
86 | * |
||
87 | 1 | * @param array $options |
|
88 | * @return array Authorization parameters |
||
89 | 1 | */ |
|
90 | protected function getAuthorizationParameters(array $options) |
||
101 | |||
102 | /** |
||
103 | * Requests an access token using a specified grant and option set. |
||
104 | * |
||
105 | * @param mixed $grant |
||
106 | * @param array $options |
||
107 | * @return AccessToken |
||
108 | */ |
||
109 | public function getAccessToken($grant, array $options = []) |
||
120 | 1 | ||
121 | /** |
||
122 | 1 | * Generates a resource owner object from a successful resource owner |
|
123 | * details request. |
||
124 | * |
||
125 | * @param array $response |
||
126 | * @param AccessToken $token |
||
127 | * @return ResourceOwnerInterface |
||
128 | */ |
||
129 | protected function createResourceOwner(array $response, AccessToken $token) |
||
133 | |||
134 | /** |
||
135 | * Requests and returns the resource owner of given access token. |
||
136 | * |
||
137 | * @param AccessToken $token |
||
138 | * @return ResourceOwnerInterface |
||
139 | */ |
||
140 | public function getResourceOwner(AccessToken $token) |
||
144 | } |
||
145 |
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.