catch (TransportExceptionInterface
$e) { throw new TransportException('Could not reach the remote SpotHit server.',
$response, 0,
$e);
} catch (HttpExceptionInterface|DecodingExceptionInterface
$e) { throw new TransportException('Unexpected reply from the remote SpotHit server.',
$response, 0,
$e);
} if (!
$data['resultat'
]) { $errors = \
is_array($data['erreurs'
]) ?
implode(',',
$data['erreurs'
]) :
$data['erreurs'
];
throw new TransportException(sprintf('[HTTP %d] Unable to send the SMS: error(s) "%s".',
$response->
getStatusCode(),
$errors),
$response);
} $sentMessage =
new SentMessage($message,
(string) $this);
$sentMessage->
setMessageId($data['id'
]);
return $sentMessage;
}}