Conditions | 3 |
Paths | 3 |
Total Lines | 27 |
Code Lines | 15 |
Lines | 0 |
Ratio | 0 % |
Changes | 1 | ||
Bugs | 0 | Features | 1 |
1 | <?php |
||
22 | public function getTokenCredentials(TemporaryCredentials $temporaryCredentials, $temporaryIdentifier, $verifier) |
||
23 | { |
||
24 | if ($temporaryIdentifier !== $temporaryCredentials->getIdentifier()) { |
||
25 | throw new \InvalidArgumentException( |
||
26 | 'Temporary identifier passed back by server does not match that of stored temporary credentials. |
||
27 | Potential man-in-the-middle.' |
||
28 | ); |
||
29 | } |
||
30 | |||
31 | $uri = $this->urlTokenCredentials(); |
||
32 | $bodyParameters = array('oauth_verifier' => $verifier); |
||
33 | |||
34 | $client = $this->createHttpClient(); |
||
35 | |||
36 | $headers = $this->getHeaders($temporaryCredentials, 'POST', $uri, $bodyParameters); |
||
37 | |||
38 | try { |
||
39 | $response = $client->post($uri, $headers, $bodyParameters)->send(); |
||
40 | } catch (BadResponseException $e) { |
||
41 | return $this->handleTokenCredentialsBadResponse($e); |
||
|
|||
42 | } |
||
43 | |||
44 | return [ |
||
45 | 'tokenCredentials' => $this->createTokenCredentials($response->getBody()), |
||
46 | 'credentialsResponseBody' => $response->getBody(), |
||
47 | ]; |
||
48 | } |
||
49 | } |
||
50 |
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: