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 | 4 | public function __construct(array $options = [], array $collaborators = []) |
|
60 | |||
61 | /** |
||
62 | * Creates an access token from a response. |
||
63 | * |
||
64 | * The grant that was used to fetch the response can be used to provide |
||
65 | * additional context. |
||
66 | * |
||
67 | * @param array $response |
||
68 | * @param AbstractGrant $grant |
||
69 | * @return AccessTokenInterface |
||
70 | */ |
||
71 | protected function createAccessToken(array $response, AbstractGrant $grant) |
||
75 | |||
76 | /** |
||
77 | * Get the string used to separate scopes. |
||
78 | * |
||
79 | * @return string |
||
80 | */ |
||
81 | 3 | protected function getScopeSeparator() |
|
85 | |||
86 | /** |
||
87 | * Change response mode when scope requires it |
||
88 | * |
||
89 | * @param array $options |
||
90 | * |
||
91 | * @return array |
||
92 | */ |
||
93 | 3 | protected function getAuthorizationParameters(array $options) |
|
101 | |||
102 | /** |
||
103 | * @param AccessToken $token |
||
104 | * |
||
105 | * @return mixed |
||
106 | */ |
||
107 | protected function fetchResourceOwnerDetails(AccessToken $token) |
||
112 | |||
113 | /** |
||
114 | * Get authorization url to begin OAuth flow |
||
115 | * |
||
116 | * @return string |
||
117 | */ |
||
118 | 3 | public function getBaseAuthorizationUrl() |
|
122 | |||
123 | /** |
||
124 | * Get access token url to retrieve token |
||
125 | * |
||
126 | * @return string |
||
127 | */ |
||
128 | 1 | public function getBaseAccessTokenUrl(array $params) |
|
132 | |||
133 | /** |
||
134 | * Get provider url to fetch user details |
||
135 | * |
||
136 | * @param AccessToken $token |
||
137 | * |
||
138 | * @return string |
||
139 | * @throws Exception |
||
140 | */ |
||
141 | public function getResourceOwnerDetailsUrl(AccessToken $token) |
||
145 | |||
146 | /** |
||
147 | * Get the default scopes used by this provider. |
||
148 | * |
||
149 | * This should not be a complete list of all scopes, but the minimum |
||
150 | * required for the provider user interface! |
||
151 | * |
||
152 | * @return array |
||
153 | */ |
||
154 | 2 | protected function getDefaultScopes() |
|
158 | |||
159 | /** |
||
160 | * Check a provider response for errors. |
||
161 | * |
||
162 | * @param ResponseInterface $response |
||
163 | * @param array $data Parsed response data |
||
164 | * @return void |
||
165 | * @throws AppleAccessDeniedException |
||
166 | */ |
||
167 | protected function checkResponse(ResponseInterface $response, $data) |
||
177 | |||
178 | /** |
||
179 | * Generate a user object from a successful user details request. |
||
180 | * |
||
181 | * @param array $response |
||
182 | * @param Apple $token |
||
183 | * @return AppleResourceOwner |
||
184 | */ |
||
185 | protected function createResourceOwner(array $response, AccessToken $token) |
||
192 | |||
193 | /** |
||
194 | * {@inheritDoc} |
||
195 | */ |
||
196 | public function getAccessToken($grant, array $options = []) |
||
224 | |||
225 | /** |
||
226 | * @return \Jose\Component\Core\JWK |
||
227 | */ |
||
228 | public function getLocalKey() |
||
232 | } |
||
233 |
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: