| Conditions | 2 |
| Paths | 2 |
| Total Lines | 15 |
| Code Lines | 9 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 9 |
| CRAP Score | 2 |
| Changes | 0 | ||
| 1 | <?php |
||
| 41 | 3 | public function sendData($data) |
|
| 42 | { |
||
| 43 | 3 | $request = new Request( |
|
| 44 | 3 | 'GET', |
|
| 45 | 3 | $this->endpoint . '?' . http_build_query(['version' => $this->getVersion(), 'text' => $this->getText()]), |
|
| 46 | 3 | ['Authorization' => 'Basic ' . base64_encode($data['username'] . ':' . $data['password'])] |
|
| 47 | 2 | ); |
|
| 48 | |||
| 49 | try { |
||
| 50 | 3 | $response = $this->httpClient->send($request); |
|
|
|
|||
| 51 | 2 | } catch (ClientException $e) { |
|
| 52 | } |
||
| 53 | |||
| 54 | 3 | return $this->response = new ToneResponse($this, $response->getBody()); |
|
| 55 | } |
||
| 56 | } |
||
| 57 |
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: