1 | <?php |
||
11 | class Kobas extends AbstractProvider |
||
12 | { |
||
13 | use BearerAuthorizationTrait; |
||
14 | /** |
||
15 | * Default scopes |
||
16 | * |
||
17 | * @var array |
||
18 | */ |
||
19 | public $defaultScopes = ['integration']; |
||
20 | |||
21 | /** |
||
22 | * Kobas OAuth URL |
||
23 | * |
||
24 | * @var string |
||
25 | */ |
||
26 | public $url = 'https://oauth.kobas.co.uk'; |
||
27 | |||
28 | /** |
||
29 | * Kobas Company ID |
||
30 | * |
||
31 | * @var int |
||
32 | */ |
||
33 | public $companyId; |
||
34 | |||
35 | /** |
||
36 | * Get authorization url to begin OAuth flow |
||
37 | * |
||
38 | * @return string |
||
39 | */ |
||
40 | 9 | public function getBaseAuthorizationUrl() |
|
44 | |||
45 | |||
46 | /** |
||
47 | * Get access token url to retrieve token |
||
48 | * |
||
49 | * @return string |
||
50 | */ |
||
51 | 15 | public function getBaseAccessTokenUrl(array $params) |
|
55 | |||
56 | /** |
||
57 | * Get provider url to fetch user details |
||
58 | * |
||
59 | * @param AccessToken $token |
||
60 | * |
||
61 | * @return string |
||
62 | */ |
||
63 | 6 | public function getResourceOwnerDetailsUrl(AccessToken $token) |
|
64 | { |
||
65 | 6 | return $this->url . '/me'; |
|
66 | } |
||
67 | |||
68 | /** |
||
69 | * Get the default scopes used by this provider. |
||
70 | * |
||
71 | * This should not be a complete list of all scopes, but the minimum |
||
72 | * required for the provider user interface! |
||
73 | * |
||
74 | * @return array |
||
75 | */ |
||
76 | 6 | protected function getDefaultScopes() |
|
80 | |||
81 | /** |
||
82 | * Returns the string that should be used to separate scopes when building |
||
83 | * the URL for requesting an access token. |
||
84 | * |
||
85 | * @return string Scope separator, defaults to ' ' |
||
86 | */ |
||
87 | 9 | protected function getScopeSeparator() |
|
91 | |||
92 | /** |
||
93 | * Check a provider response for errors. |
||
94 | * |
||
95 | * @throws IdentityProviderException |
||
96 | * @param ResponseInterface $response |
||
97 | * @param string $data Parsed response data |
||
98 | * @return void |
||
99 | */ |
||
100 | 12 | protected function checkResponse(ResponseInterface $response, $data) |
|
111 | |||
112 | /** |
||
113 | * Generate a user object from a successful user details request. |
||
114 | * |
||
115 | * @param object $response |
||
116 | * @param AccessToken $token |
||
117 | * @return KobasResourceOwner |
||
118 | */ |
||
119 | 3 | protected function createResourceOwner(array $response, AccessToken $token) |
|
123 | } |
||
124 |
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: