1 | <?php |
||
12 | class Wecounsel extends AbstractProvider |
||
13 | { |
||
14 | use ArrayAccessorTrait, |
||
15 | BearerAuthorizationTrait; |
||
16 | |||
17 | /** |
||
18 | * Wecounsel environment specific host; defaults to api |
||
19 | * |
||
20 | * @var string |
||
21 | */ |
||
22 | protected $host = 'https://api.wecounsel.com'; |
||
23 | |||
24 | /** |
||
25 | * Returns an authenticated PSR-7 request instance. |
||
26 | * |
||
27 | * @param string $method |
||
28 | * @param string $url |
||
29 | * @param AccessToken|string $token |
||
30 | * @param array $options Any of "headers", "body", and "protocolVersion". |
||
31 | * @return \Psr\Http\Message\RequestInterface |
||
32 | */ |
||
33 | 6 | public function getAuthenticatedRequest($method, $url, $token, array $options = []) |
|
39 | |||
40 | /** |
||
41 | * Get authorization url to begin OAuth flow |
||
42 | * |
||
43 | * @return string |
||
44 | */ |
||
45 | 9 | public function getBaseAuthorizationUrl() |
|
49 | |||
50 | /** |
||
51 | * Get access token url to retrieve token |
||
52 | * |
||
53 | * @return string |
||
54 | */ |
||
55 | 12 | public function getBaseAccessTokenUrl(array $params) |
|
59 | |||
60 | /** |
||
61 | * Get provider url to fetch user details |
||
62 | * |
||
63 | * @param AccessToken $token |
||
64 | * |
||
65 | * @return string |
||
66 | */ |
||
67 | 6 | public function getResourceOwnerDetailsUrl(AccessToken $token) |
|
71 | |||
72 | /** |
||
73 | * Get the default scopes used by this provider. |
||
74 | * |
||
75 | * This should not be a complete list of all scopes, but the minimum |
||
76 | * required for the provider user interface! |
||
77 | * |
||
78 | * @return array |
||
79 | */ |
||
80 | 6 | protected function getDefaultScopes() |
|
84 | |||
85 | /** |
||
86 | * Returns a cleaned host. |
||
87 | * |
||
88 | * @return string |
||
89 | */ |
||
90 | 27 | public function getHost() |
|
94 | |||
95 | /** |
||
96 | * Returns the string that should be used to separate scopes when building |
||
97 | * the URL for requesting an access token. |
||
98 | * |
||
99 | * @return string Scope separator, defaults to ' ' |
||
100 | */ |
||
101 | 9 | protected function getScopeSeparator() |
|
105 | |||
106 | /** |
||
107 | * Check a provider response for errors. |
||
108 | * |
||
109 | * @throws IdentityProviderException |
||
110 | * @param ResponseInterface $response |
||
111 | * @param string $data Parsed response data |
||
112 | * @return void |
||
113 | */ |
||
114 | 9 | protected function checkResponse(ResponseInterface $response, $data) |
|
123 | |||
124 | /** |
||
125 | * Generate a user object from a successful user details request. |
||
126 | * |
||
127 | * @param object $response |
||
128 | * @param AccessToken $token |
||
129 | * @return WecounselResourceOwner |
||
130 | */ |
||
131 | 3 | protected function createResourceOwner(array $response, AccessToken $token) |
|
135 | } |
||
136 |
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: