| Conditions | 2 |
| Paths | 2 |
| Total Lines | 18 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 9 |
| CRAP Score | 2.024 |
| Changes | 0 | ||
| 1 | <?php |
||
| 38 | 1 | public function send(SmsMessage $message): void |
|
| 39 | { |
||
| 40 | try { |
||
| 41 | 1 | $this->httpClient->post( |
|
| 42 | 1 | self::API_BASE_URL . "/v1/Account/{$this->authId}/Message/", |
|
| 43 | [ |
||
| 44 | 1 | RequestOptions::AUTH => [$this->authId, $this->authToken], |
|
| 45 | 1 | RequestOptions::JSON => [ |
|
| 46 | 1 | 'src' => $message->from, |
|
| 47 | 1 | 'dst' => $message->to, |
|
| 48 | 1 | 'text' => $message->text, |
|
| 49 | ], |
||
| 50 | ] |
||
| 51 | ); |
||
| 52 | } catch (GuzzleException $exception) { |
||
| 53 | throw SendingMessageFailed::dueTo($exception); |
||
| 54 | } |
||
| 55 | 1 | } |
|
| 56 | } |
||
| 57 |