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 | * Constructs an OAuth 2.0 service provider. |
||
25 | * |
||
26 | * @param array $options An array of options to set on this provider. |
||
27 | * Options include `clientId`, `clientSecret`, `redirectUri`, `state`, `apiVersion`. |
||
28 | * Individual providers may introduce more options, as needed. |
||
29 | * @param array $collaborators An array of collaborators that may be used to |
||
30 | * override this provider's default behavior. Collaborators include |
||
31 | * `grantFactory`, `requestFactory`, `httpClient`, and `randomFactory`. |
||
32 | * Individual providers may introduce more collaborators, as needed. |
||
33 | */ |
||
34 | 21 | public function __construct(array $options = [], array $collaborators = []) |
|
44 | |||
45 | /** |
||
46 | * Get authorization url to begin OAuth flow |
||
47 | * |
||
48 | * @return string |
||
49 | */ |
||
50 | 12 | public function getBaseAuthorizationUrl() |
|
54 | |||
55 | /** |
||
56 | * Get access token url to retrieve token |
||
57 | * |
||
58 | * @param array $params |
||
59 | * |
||
60 | * @return string |
||
61 | */ |
||
62 | 12 | public function getBaseAccessTokenUrl(array $params) |
|
66 | |||
67 | /** |
||
68 | * Get provider url to fetch user details |
||
69 | * |
||
70 | * @param AccessToken $token |
||
71 | * |
||
72 | * @return string |
||
73 | */ |
||
74 | public function getResourceOwnerDetailsUrl(AccessToken $token) |
||
78 | |||
79 | /** |
||
80 | * @link http://developer.tomtom.com/products/sports/mysportscloud/authorization/ |
||
81 | * |
||
82 | * Get the default scopes used by this provider. |
||
83 | * |
||
84 | * This should not be a complete list of all scopes, but the minimum |
||
85 | * required for the provider user interface! |
||
86 | * |
||
87 | * @return array |
||
88 | */ |
||
89 | 6 | protected function getDefaultScopes() |
|
93 | |||
94 | /** |
||
95 | * Check a provider response for errors. |
||
96 | * |
||
97 | * @throws IdentityProviderException |
||
98 | * @param ResponseInterface $response |
||
99 | * @param string $data Parsed response data |
||
100 | * @return void |
||
101 | */ |
||
102 | 9 | protected function checkResponse(ResponseInterface $response, $data) |
|
112 | |||
113 | /** |
||
114 | * Generate a user object from a successful user details request. |
||
115 | * |
||
116 | * @param array $response |
||
117 | * @param AccessToken $token |
||
118 | * @return null |
||
119 | */ |
||
120 | 1 | protected function createResourceOwner(array $response, AccessToken $token) |
|
124 | |||
125 | /** |
||
126 | * @return string |
||
127 | */ |
||
128 | 3 | public function getBaseMySportsUrl() |
|
132 | |||
133 | /** |
||
134 | * @return string |
||
135 | */ |
||
136 | 3 | public function getApiVersion() |
|
137 | { |
||
138 | 3 | return $this->apiVersion; |
|
139 | } |
||
140 | |||
141 | /** |
||
142 | * Returns the default headers used by this provider. |
||
143 | * |
||
144 | * Typically this is used to set 'Accept' or 'Content-Type' headers. |
||
145 | * |
||
146 | * @return array |
||
147 | */ |
||
148 | 9 | protected function getDefaultHeaders() |
|
155 | } |
||
156 |
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: