1 | <?php |
||
9 | class TomTomMySports extends AbstractProvider |
||
10 | { |
||
11 | use BearerAuthorizationTrait; |
||
12 | |||
13 | /** |
||
14 | * @var string |
||
15 | */ |
||
16 | const BASE_MYSPORTS_URL = 'https://api.tomtom.com/mysports'; |
||
17 | |||
18 | /** |
||
19 | * @var string |
||
20 | */ |
||
21 | protected $apiVersion = '1'; |
||
22 | |||
23 | /** |
||
24 | * @var string |
||
25 | */ |
||
26 | protected $apikey; |
||
27 | |||
28 | /** |
||
29 | * @inheritDoc |
||
30 | */ |
||
31 | 9 | protected function getAuthorizationParameters(array $options) |
|
68 | |||
69 | |||
70 | /** |
||
71 | * Get authorization url to begin OAuth flow |
||
72 | * |
||
73 | * @return string |
||
74 | */ |
||
75 | 12 | public function getBaseAuthorizationUrl() |
|
79 | |||
80 | /** |
||
81 | * Get access token url to retrieve token |
||
82 | * |
||
83 | * @param array $params |
||
84 | * |
||
85 | * @return string |
||
86 | */ |
||
87 | 12 | public function getBaseAccessTokenUrl(array $params) |
|
91 | |||
92 | /** |
||
93 | * Get provider url to fetch user details |
||
94 | * |
||
95 | * @param AccessToken $token |
||
96 | * |
||
97 | * @return string |
||
98 | */ |
||
99 | public function getResourceOwnerDetailsUrl(AccessToken $token) |
||
103 | |||
104 | /** |
||
105 | * @link http://developer.tomtom.com/products/sports/mysportscloud/authorization/ |
||
106 | * |
||
107 | * Get the default scopes used by this provider. |
||
108 | * |
||
109 | * This should not be a complete list of all scopes, but the minimum |
||
110 | * required for the provider user interface! |
||
111 | * |
||
112 | * @return array |
||
113 | */ |
||
114 | 6 | protected function getDefaultScopes() |
|
118 | |||
119 | /** |
||
120 | * Check a provider response for errors. |
||
121 | * |
||
122 | * @throws IdentityProviderException |
||
123 | * @param ResponseInterface $response |
||
124 | * @param string $data Parsed response data |
||
125 | * @return void |
||
126 | */ |
||
127 | 9 | protected function checkResponse(ResponseInterface $response, $data) |
|
137 | |||
138 | /** |
||
139 | * Generate a user object from a successful user details request. |
||
140 | * |
||
141 | * @param array $response |
||
142 | * @param AccessToken $token |
||
143 | * @return null |
||
144 | */ |
||
145 | protected function createResourceOwner(array $response, AccessToken $token) |
||
149 | |||
150 | /** |
||
151 | * @return string |
||
152 | */ |
||
153 | 3 | public function getBaseMySportsUrl() |
|
157 | |||
158 | /** |
||
159 | * @return string |
||
160 | */ |
||
161 | 3 | public function getApiVersion() |
|
165 | |||
166 | /** |
||
167 | * Returns the default headers used by this provider. |
||
168 | * |
||
169 | * Typically this is used to set 'Accept' or 'Content-Type' headers. |
||
170 | * |
||
171 | * @return array |
||
172 | */ |
||
173 | 9 | protected function getDefaultHeaders() |
|
180 | } |
||
181 |
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: