1 | <?php namespace Stevenmaguire\OAuth2\Client\Provider; |
||
9 | class Zendesk extends AbstractProvider |
||
10 | { |
||
11 | use BearerAuthorizationTrait; |
||
12 | |||
13 | protected $subdomain; |
||
14 | |||
15 | /** |
||
16 | * @var string Key used in a token response to identify the resource owner. |
||
17 | */ |
||
18 | const ACCESS_TOKEN_RESOURCE_OWNER_ID = 'id'; |
||
19 | |||
20 | /** |
||
21 | * Constructs an OAuth 2.0 service provider. |
||
22 | * |
||
23 | * @param array $options An array of options to set on this provider. |
||
24 | * Options include `clientId`, `clientSecret`, `redirectUri`, and `state`. |
||
25 | * Individual providers may introduce more options, as needed. |
||
26 | * @param array $collaborators An array of collaborators that may be used to |
||
27 | * override this provider's default behavior. Collaborators include |
||
28 | * `grantFactory`, `requestFactory`, `httpClient`, and `randomFactory`. |
||
29 | * Individual providers may introduce more collaborators, as needed. |
||
30 | */ |
||
31 | 18 | public function __construct(array $options = [], array $collaborators = []) |
|
41 | |||
42 | /** |
||
43 | * Get authorization url to begin OAuth flow |
||
44 | * |
||
45 | * @return string |
||
46 | */ |
||
47 | 6 | public function getBaseAuthorizationUrl() |
|
51 | |||
52 | /** |
||
53 | * Get access token url to retrieve token |
||
54 | * |
||
55 | * @return string |
||
56 | */ |
||
57 | 8 | public function getBaseAccessTokenUrl(array $params) |
|
61 | |||
62 | /** |
||
63 | * Get provider url to fetch user details |
||
64 | * |
||
65 | * @param AccessToken $token |
||
66 | * |
||
67 | * @return string |
||
68 | */ |
||
69 | 2 | public function getResourceOwnerDetailsUrl(AccessToken $token) |
|
73 | |||
74 | /** |
||
75 | * Get the default scopes used by this provider. |
||
76 | * |
||
77 | * This should not be a complete list of all scopes, but the minimum |
||
78 | * required for the provider user interface! |
||
79 | * |
||
80 | * @return array |
||
81 | */ |
||
82 | 4 | protected function getDefaultScopes() |
|
86 | |||
87 | /** |
||
88 | * Returns the string that should be used to separate scopes when building |
||
89 | * the URL for requesting an access token. |
||
90 | * |
||
91 | * @return string Scope separator, defaults to ',' |
||
92 | */ |
||
93 | 6 | protected function getScopeSeparator() |
|
97 | |||
98 | /** |
||
99 | * Check a provider response for errors. |
||
100 | * |
||
101 | * @throws IdentityProviderException |
||
102 | * @param ResponseInterface $response |
||
103 | * @param string $data Parsed response data |
||
104 | * @return void |
||
105 | */ |
||
106 | 6 | protected function checkResponse(ResponseInterface $response, $data) |
|
117 | |||
118 | /** |
||
119 | * Generate a user object from a successful user details request. |
||
120 | * |
||
121 | * @param object $response |
||
122 | * @param AccessToken $token |
||
123 | * @return ZendeskResourceOwner |
||
124 | */ |
||
125 | 2 | protected function createResourceOwner(array $response, AccessToken $token) |
|
129 | |||
130 | /** |
||
131 | * Retrieves currently configured subdomain. |
||
132 | * |
||
133 | * @return string |
||
134 | */ |
||
135 | 2 | public function getSubdomain() |
|
139 | |||
140 | /** |
||
141 | * Updates currently configured subdomain. |
||
142 | * |
||
143 | * @param string $subdomain |
||
144 | * |
||
145 | * @return Zendesk |
||
146 | */ |
||
147 | 2 | public function setSubdomain($subdomain) |
|
155 | } |
||
156 |
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: