@@ -43,13 +43,13 @@ public function __toString(): string
43
43
{
44
44
$ region = $ this ->region ? '?region= ' .$ this ->region : '' ;
45
45
46
- return sprintf ('scaleway+api://%s@%s%s ' , $ this ->getEndpoint (), $ this ->projectId , $ region );
46
+ return \ sprintf ('scaleway+api://%s@%s%s ' , $ this ->getEndpoint (), $ this ->projectId , $ region );
47
47
}
48
48
49
49
protected function doSendApi (SentMessage $ sentMessage , Email $ email , Envelope $ envelope ): ResponseInterface
50
50
{
51
51
$ region = $ this ->region ?? 'fr-par ' ;
52
- $ path = sprintf ('/transactional-email/v1alpha1/regions/%s/emails ' , $ region );
52
+ $ path = \ sprintf ('/transactional-email/v1alpha1/regions/%s/emails ' , $ region );
53
53
54
54
$ response = $ this ->client ->request ('POST ' , 'https:// ' .$ this ->getEndpoint ().$ path , [
55
55
'json ' => $ this ->getPayload ($ email , $ envelope ),
@@ -62,13 +62,13 @@ protected function doSendApi(SentMessage $sentMessage, Email $email, Envelope $e
62
62
$ statusCode = $ response ->getStatusCode ();
63
63
$ result = $ response ->toArray (false );
64
64
} catch (DecodingExceptionInterface $ e ) {
65
- throw new HttpTransportException ('Unable to send an email: ' .$ response ->getContent (false ).sprintf (' (code %d). ' , $ statusCode ), $ response );
65
+ throw new HttpTransportException ('Unable to send an email: ' .$ response ->getContent (false ).\ sprintf (' (code %d). ' , $ statusCode ), $ response );
66
66
} catch (TransportExceptionInterface $ e ) {
67
67
throw new HttpTransportException ('Could not reach the remote Scaleway server. ' , $ response , 0 , $ e );
68
68
}
69
69
70
70
if (200 !== $ statusCode ) {
71
- throw new HttpTransportException ('Unable to send an email: ' .$ result ['message ' ].sprintf (' (code %d). ' , $ statusCode ), $ response );
71
+ throw new HttpTransportException ('Unable to send an email: ' .$ result ['message ' ].\ sprintf (' (code %d). ' , $ statusCode ), $ response );
72
72
}
73
73
74
74
$ sentMessage ->setMessageId ($ result ['emails ' ][0 ]['message_id ' ]);
0 commit comments