1 | <?php namespace Stevenmaguire\OAuth2\Client\Provider; |
||
9 | class Microsoft extends AbstractProvider |
||
10 | { |
||
11 | /** |
||
12 | * No access token type |
||
13 | * |
||
14 | * @var string |
||
15 | */ |
||
16 | const ACCESS_TOKEN_TYPE_NONE = ''; |
||
17 | |||
18 | /** |
||
19 | * Access token type 'Bearer' |
||
20 | * |
||
21 | * @var string |
||
22 | */ |
||
23 | const ACCESS_TOKEN_TYPE_BEARER = 'Bearer'; |
||
24 | |||
25 | /** |
||
26 | * Default scopes |
||
27 | * |
||
28 | * @var array |
||
29 | */ |
||
30 | public $defaultScopes = ['wl.basic', 'wl.emails']; |
||
31 | |||
32 | /** |
||
33 | * Base url for authorization. |
||
34 | * |
||
35 | * @var string |
||
36 | */ |
||
37 | protected $urlAuthorize = 'https://login.live.com/oauth20_authorize.srf'; |
||
38 | |||
39 | /** |
||
40 | * Base url for access token. |
||
41 | * |
||
42 | * @var string |
||
43 | */ |
||
44 | protected $urlAccessToken = 'https://login.live.com/oauth20_token.srf'; |
||
45 | |||
46 | /** |
||
47 | * Base url for resource owner. |
||
48 | * |
||
49 | * @var string |
||
50 | */ |
||
51 | protected $urlResourceOwnerDetails = 'https://apis.live.net/v5.0/me'; |
||
52 | |||
53 | /** |
||
54 | * The access token type to use. Defaults to none. |
||
55 | * |
||
56 | * @var string |
||
57 | */ |
||
58 | protected $accessTokenType = self::ACCESS_TOKEN_TYPE_NONE; |
||
59 | |||
60 | /** |
||
61 | * Get authorization url to begin OAuth flow |
||
62 | * |
||
63 | * @return string |
||
64 | */ |
||
65 | 12 | public function getBaseAuthorizationUrl() |
|
69 | |||
70 | /** |
||
71 | * Get access token url to retrieve token |
||
72 | * |
||
73 | * @return string |
||
74 | */ |
||
75 | 15 | public function getBaseAccessTokenUrl(array $params) |
|
79 | |||
80 | /** |
||
81 | * Sets the access token type used for authorization. |
||
82 | * |
||
83 | * @param string The access token type to use. |
||
84 | */ |
||
85 | 3 | public function setAccessTokenType($accessTokenType) |
|
89 | |||
90 | /** |
||
91 | * Get default scopes |
||
92 | * |
||
93 | * @return array |
||
94 | */ |
||
95 | 9 | protected function getDefaultScopes() |
|
99 | |||
100 | /** |
||
101 | * Check a provider response for errors. |
||
102 | * |
||
103 | * @throws IdentityProviderException |
||
104 | * @param ResponseInterface $response |
||
105 | * @return void |
||
106 | */ |
||
107 | 9 | protected function checkResponse(ResponseInterface $response, $data) |
|
117 | |||
118 | /** |
||
119 | * Generate a user object from a successful user details request. |
||
120 | * |
||
121 | * @param array $response |
||
122 | * @param AccessToken $token |
||
123 | * @return MicrosoftResourceOwner |
||
124 | */ |
||
125 | 3 | protected function createResourceOwner(array $response, AccessToken $token) |
|
129 | |||
130 | /** |
||
131 | * Get provider url to fetch user details |
||
132 | * |
||
133 | * @param AccessToken $token |
||
134 | * |
||
135 | * @return string |
||
136 | */ |
||
137 | 6 | public function getResourceOwnerDetailsUrl(AccessToken $token) |
|
143 | |||
144 | /** |
||
145 | * Returns the authorization headers used by this provider. |
||
146 | * |
||
147 | * @param mixed|null $token Either a string or an access token instance |
||
148 | * @return array |
||
149 | */ |
||
150 | 6 | protected function getAuthorizationHeaders($token = null) |
|
160 | } |
||
161 |
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: