1 | <?php |
||
14 | class Salesforce extends AbstractProvider |
||
15 | { |
||
16 | use BearerAuthorizationTrait; |
||
17 | |||
18 | /** |
||
19 | * @var string Key used in a token response to identify the resource owner. |
||
20 | */ |
||
21 | const ACCESS_TOKEN_RESOURCE_OWNER_ID = 'id'; |
||
22 | |||
23 | /** |
||
24 | * Base domain used for authentication |
||
25 | * |
||
26 | * @var string |
||
27 | */ |
||
28 | protected $domain = 'https://login.salesforce.com'; |
||
29 | |||
30 | /** |
||
31 | * Get authorization url to begin OAuth flow |
||
32 | * |
||
33 | * @return string |
||
34 | */ |
||
35 | 6 | public function getBaseAuthorizationUrl() |
|
39 | |||
40 | /** |
||
41 | * Get access token url to retrieve token |
||
42 | * |
||
43 | * @return string |
||
44 | */ |
||
45 | 8 | public function getBaseAccessTokenUrl(array $params) |
|
49 | |||
50 | /** |
||
51 | * Get provider url to fetch user details |
||
52 | * |
||
53 | * @param AccessToken $token |
||
54 | * |
||
55 | * @return string |
||
56 | */ |
||
57 | 2 | public function getResourceOwnerDetailsUrl(AccessToken $token) |
|
61 | |||
62 | /** |
||
63 | * Get the default scopes used by this provider. |
||
64 | * |
||
65 | * This should not be a complete list of all scopes, but the minimum |
||
66 | * required for the provider user interface! |
||
67 | * |
||
68 | * @return array |
||
69 | */ |
||
70 | 4 | protected function getDefaultScopes() |
|
74 | |||
75 | /** |
||
76 | * Retrives the currently configured provider domain. |
||
77 | * |
||
78 | * @return string |
||
79 | */ |
||
80 | 4 | public function getDomain() |
|
84 | |||
85 | /** |
||
86 | * Returns the string that should be used to separate scopes when building |
||
87 | * the URL for requesting an access token. |
||
88 | * |
||
89 | * @return string Scope separator, defaults to ',' |
||
90 | */ |
||
91 | 6 | protected function getScopeSeparator() |
|
95 | |||
96 | /** |
||
97 | * Check a provider response for errors. |
||
98 | * |
||
99 | * @throws IdentityProviderException |
||
100 | * @param ResponseInterface $response |
||
101 | * @param string $data Parsed response data |
||
102 | * @return void |
||
103 | */ |
||
104 | 6 | protected function checkResponse(ResponseInterface $response, $data) |
|
115 | |||
116 | /** |
||
117 | * Generate a user object from a successful user details request. |
||
118 | * |
||
119 | * @param object $response |
||
120 | * @param AccessToken $token |
||
121 | * @return SalesforceResourceOwner |
||
122 | */ |
||
123 | 2 | protected function createResourceOwner(array $response, AccessToken $token) |
|
127 | |||
128 | /** |
||
129 | * Creates an access token from a response. |
||
130 | * |
||
131 | * The grant that was used to fetch the response can be used to provide |
||
132 | * additional context. |
||
133 | * |
||
134 | * @param array $response |
||
135 | * @param AbstractGrant $grant |
||
136 | * @return AccessToken |
||
137 | */ |
||
138 | 4 | protected function createAccessToken(array $response, AbstractGrant $grant) |
|
142 | |||
143 | /** |
||
144 | * Updates the provider domain with a given value. |
||
145 | * |
||
146 | * @throws InvalidArgumentException |
||
147 | * @param string $domain |
||
148 | * @return Salesforce |
||
149 | */ |
||
150 | 4 | public function setDomain($domain) |
|
162 | } |
||
163 |
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: