1 | <?php namespace Stevenmaguire\OAuth2\Client\Provider; |
||
9 | class Microsoft extends AbstractProvider |
||
10 | { |
||
11 | /** |
||
12 | * Default scopes |
||
13 | * |
||
14 | * @var array |
||
15 | */ |
||
16 | public $defaultScopes = ['wl.basic', 'wl.emails']; |
||
17 | |||
18 | /** |
||
19 | * Base url for authorization. |
||
20 | * |
||
21 | * @var string |
||
22 | */ |
||
23 | protected $urlAuthorize = 'https://login.live.com/oauth20_authorize.srf'; |
||
24 | |||
25 | /** |
||
26 | * Base url for access token. |
||
27 | * |
||
28 | * @var string |
||
29 | */ |
||
30 | protected $urlAccessToken = 'https://login.live.com/oauth20_token.srf'; |
||
31 | |||
32 | /** |
||
33 | * Base url for resource owner. |
||
34 | * |
||
35 | * @var string |
||
36 | */ |
||
37 | protected $urlResourceOwnerDetails = 'https://apis.live.net/v5.0/me'; |
||
38 | |||
39 | /** |
||
40 | * Get authorization url to begin OAuth flow |
||
41 | * |
||
42 | * @return string |
||
43 | */ |
||
44 | 12 | public function getBaseAuthorizationUrl() |
|
48 | |||
49 | /** |
||
50 | * Get access token url to retrieve token |
||
51 | * |
||
52 | * @return string |
||
53 | */ |
||
54 | 18 | public function getBaseAccessTokenUrl(array $params) |
|
58 | |||
59 | /** |
||
60 | * Get default scopes |
||
61 | * |
||
62 | * @return array |
||
63 | */ |
||
64 | 9 | protected function getDefaultScopes() |
|
68 | |||
69 | /** |
||
70 | * Check a provider response for errors. |
||
71 | * |
||
72 | * @throws IdentityProviderException |
||
73 | * @param ResponseInterface $response |
||
74 | * @return void |
||
75 | */ |
||
76 | 12 | protected function checkResponse(ResponseInterface $response, $data) |
|
86 | |||
87 | /** |
||
88 | * Generate a user object from a successful user details request. |
||
89 | * |
||
90 | * @param array $response |
||
91 | * @param AccessToken $token |
||
92 | * @return MicrosoftResourceOwner |
||
93 | */ |
||
94 | 6 | protected function createResourceOwner(array $response, AccessToken $token) |
|
98 | 6 | ||
99 | /** |
||
100 | 6 | * Get provider url to fetch user details |
|
101 | * |
||
102 | * @param AccessToken $token |
||
103 | * |
||
104 | * @return string |
||
105 | */ |
||
106 | public function getResourceOwnerDetailsUrl(AccessToken $token) |
||
112 | } |
||
113 |
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: