1 | <?php |
||
11 | class Dropbox extends AbstractProvider |
||
12 | { |
||
13 | use BearerAuthorizationTrait; |
||
14 | |||
15 | /** |
||
16 | * @var string Key used in the access token response to identify the resource owner. |
||
17 | */ |
||
18 | const ACCESS_TOKEN_RESOURCE_OWNER_ID = 'account_id'; |
||
19 | |||
20 | /** |
||
21 | * Get authorization url to begin OAuth flow |
||
22 | * |
||
23 | * @return string |
||
24 | */ |
||
25 | 6 | public function getBaseAuthorizationUrl() |
|
29 | |||
30 | /** |
||
31 | * Get access token url to retrieve token |
||
32 | * |
||
33 | * @return string |
||
34 | */ |
||
35 | 8 | public function getBaseAccessTokenUrl(array $params) |
|
39 | |||
40 | /** |
||
41 | * Get provider url to fetch user details |
||
42 | * |
||
43 | * @param AccessToken $token |
||
44 | * |
||
45 | * @return string |
||
46 | */ |
||
47 | 2 | public function getResourceOwnerDetailsUrl(AccessToken $token) |
|
51 | |||
52 | /** |
||
53 | * Get the default scopes used by this provider. |
||
54 | * |
||
55 | * This should not be a complete list of all scopes, but the minimum |
||
56 | * required for the provider user interface! |
||
57 | * |
||
58 | * @return array |
||
59 | */ |
||
60 | 4 | protected function getDefaultScopes() |
|
64 | |||
65 | /** |
||
66 | * Check a provider response for errors. |
||
67 | * |
||
68 | * @link https://www.dropbox.com/developers/core/docs |
||
69 | * @throws IdentityProviderException |
||
70 | * @param ResponseInterface $response |
||
71 | * @param string $data Parsed response data |
||
72 | * @return void |
||
73 | */ |
||
74 | 6 | protected function checkResponse(ResponseInterface $response, $data) |
|
75 | { |
||
76 | 6 | if (isset($data['error'])) { |
|
77 | 2 | throw new IdentityProviderException( |
|
78 | 2 | $data['error'] ?: $response->getReasonPhrase(), |
|
79 | 2 | $response->getStatusCode(), |
|
80 | 1 | $response |
|
|
|||
81 | 1 | ); |
|
82 | } |
||
83 | 4 | } |
|
84 | |||
85 | /** |
||
86 | * Generate a user object from a successful user details request. |
||
87 | * |
||
88 | * @param object $response |
||
89 | * @param AccessToken $token |
||
90 | * @return DropboxResourceOwner |
||
91 | */ |
||
92 | 2 | protected function createResourceOwner(array $response, AccessToken $token) |
|
96 | |||
97 | /** |
||
98 | * Requests resource owner details. |
||
99 | * |
||
100 | * @param AccessToken $token |
||
101 | * @return mixed |
||
102 | */ |
||
103 | 6 | protected function fetchResourceOwnerDetails(AccessToken $token) |
|
111 | |||
112 | /** |
||
113 | * Builds the authorization URL. |
||
114 | * |
||
115 | * @param array $options |
||
116 | * @return string Authorization URL |
||
117 | */ |
||
118 | public function getAuthorizationUrl(array $options = []) |
||
124 | } |
||
125 |
It seems like the type of the argument is not accepted by the function/method which you are calling.
In some cases, in particular if PHP’s automatic type-juggling kicks in this might be fine. In other cases, however this might be a bug.
We suggest to add an explicit type cast like in the following example: