1 | <?php |
||
20 | class Apple extends AbstractProvider |
||
21 | { |
||
22 | use BearerAuthorizationTrait; |
||
23 | |||
24 | /** |
||
25 | * Default scopes |
||
26 | * |
||
27 | * @var array |
||
28 | */ |
||
29 | public $defaultScopes = ['name', 'email']; |
||
30 | |||
31 | /** |
||
32 | * @var string the team id |
||
33 | */ |
||
34 | protected $teamId; |
||
35 | |||
36 | /** |
||
37 | * @var string the key file id |
||
38 | */ |
||
39 | protected $keyFileId; |
||
40 | |||
41 | /** |
||
42 | * @var string the key file path |
||
43 | */ |
||
44 | protected $keyFilePath; |
||
45 | |||
46 | /** |
||
47 | * Constructs Apple's OAuth 2.0 service provider. |
||
48 | * |
||
49 | * @param array $options |
||
50 | * @param array $collaborators |
||
51 | */ |
||
52 | 13 | public function __construct(array $options = [], array $collaborators = []) |
|
68 | |||
69 | /** |
||
70 | * Creates an access token from a response. |
||
71 | * |
||
72 | * The grant that was used to fetch the response can be used to provide |
||
73 | * additional context. |
||
74 | * |
||
75 | * @param array $response |
||
76 | * @param AbstractGrant $grant |
||
77 | * @return AccessTokenInterface |
||
78 | */ |
||
79 | protected function createAccessToken(array $response, AbstractGrant $grant) |
||
83 | |||
84 | /** |
||
85 | * Get the string used to separate scopes. |
||
86 | * |
||
87 | * @return string |
||
88 | */ |
||
89 | 3 | protected function getScopeSeparator() |
|
93 | |||
94 | /** |
||
95 | * Change response mode when scope requires it |
||
96 | * |
||
97 | * @param array $options |
||
98 | * |
||
99 | * @return array |
||
100 | */ |
||
101 | 3 | protected function getAuthorizationParameters(array $options) |
|
109 | |||
110 | /** |
||
111 | * @param AccessToken $token |
||
112 | * |
||
113 | * @return mixed |
||
114 | */ |
||
115 | 1 | protected function fetchResourceOwnerDetails(AccessToken $token) |
|
119 | |||
120 | /** |
||
121 | * Get authorization url to begin OAuth flow |
||
122 | * |
||
123 | * @return string |
||
124 | */ |
||
125 | 3 | public function getBaseAuthorizationUrl() |
|
129 | |||
130 | /** |
||
131 | * Get access token url to retrieve token |
||
132 | * |
||
133 | * @return string |
||
134 | */ |
||
135 | 1 | public function getBaseAccessTokenUrl(array $params) |
|
139 | |||
140 | /** |
||
141 | * Get provider url to fetch user details |
||
142 | * |
||
143 | * @param AccessToken $token |
||
144 | * |
||
145 | * @return string |
||
146 | * @throws Exception |
||
147 | */ |
||
148 | 1 | public function getResourceOwnerDetailsUrl(AccessToken $token) |
|
152 | |||
153 | /** |
||
154 | * Get the default scopes used by this provider. |
||
155 | * |
||
156 | * This should not be a complete list of all scopes, but the minimum |
||
157 | * required for the provider user interface! |
||
158 | * |
||
159 | * @return array |
||
160 | */ |
||
161 | 2 | protected function getDefaultScopes() |
|
165 | |||
166 | /** |
||
167 | * Check a provider response for errors. |
||
168 | * |
||
169 | * @param ResponseInterface $response |
||
170 | * @param array $data Parsed response data |
||
171 | * @return void |
||
172 | * @throws AppleAccessDeniedException |
||
173 | */ |
||
174 | 1 | protected function checkResponse(ResponseInterface $response, $data) |
|
184 | |||
185 | /** |
||
186 | * Generate a user object from a successful user details request. |
||
187 | * |
||
188 | * @param array $response |
||
189 | * @param Apple $token |
||
190 | * @return AppleResourceOwner |
||
191 | */ |
||
192 | 1 | protected function createResourceOwner(array $response, AccessToken $token) |
|
203 | |||
204 | /** |
||
205 | * {@inheritDoc} |
||
206 | */ |
||
207 | public function getAccessToken($grant, array $options = []) |
||
241 | |||
242 | /** |
||
243 | * @return \Jose\Component\Core\JWK |
||
244 | */ |
||
245 | 1 | public function getLocalKey() |
|
249 | } |
||
250 |
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: