Conditions | 2 |
Paths | 2 |
Total Lines | 18 |
Lines | 0 |
Ratio | 0 % |
Tests | 10 |
CRAP Score | 2 |
Changes | 0 |
1 | <?php |
||
38 | 2 | public function send(SmsMessage $message): void |
|
39 | { |
||
40 | try { |
||
41 | 2 | $this->httpClient->post( |
|
42 | 2 | self::API_BASE_URL . "/2010-04-01/Accounts/{$this->authId}/Messages.json", |
|
43 | [ |
||
44 | 2 | RequestOptions::AUTH => [$this->authId, $this->authToken], |
|
45 | RequestOptions::FORM_PARAMS => [ |
||
46 | 2 | 'Body' => $message->getText(), |
|
47 | 2 | 'From' => $message->getFrom(), |
|
48 | 2 | 'To' => $message->getTo(), |
|
49 | ], |
||
50 | ] |
||
51 | ); |
||
52 | 1 | } catch (GuzzleException $exception) { |
|
53 | 1 | throw SendingMessageFailed::dueTo($exception); |
|
54 | } |
||
55 | 1 | } |
|
56 | } |
||
57 |