Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 7d5fc82

Browse files
CS fixes
1 parent 2a2f2d9 commit 7d5fc82

2 files changed

Lines changed: 6 additions & 6 deletions

File tree

RingCentralTransport.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -33,14 +33,14 @@ public function __construct(
3333
#[\SensitiveParameter] private readonly string $apiToken,
3434
private readonly string $from,
3535
?HttpClientInterface $client = null,
36-
?EventDispatcherInterface $dispatcher = null
36+
?EventDispatcherInterface $dispatcher = null,
3737
) {
3838
parent::__construct($client, $dispatcher);
3939
}
4040

4141
public function __toString(): string
4242
{
43-
return sprintf('ringcentral://%s%s', $this->getEndpoint(), null !== $this->from ? '?from='.$this->from : '');
43+
return \sprintf('ringcentral://%s%s', $this->getEndpoint(), null !== $this->from ? '?from='.$this->from : '');
4444
}
4545

4646
public function supports(MessageInterface $message): bool
@@ -60,10 +60,10 @@ protected function doSend(MessageInterface $message): SentMessage
6060
$options['to'][]['phoneNumber'] = $message->getPhone();
6161

6262
if (!preg_match('/^\+[1-9]\d{1,14}$/', $options['from']['phoneNumber'] ?? '')) {
63-
throw new InvalidArgumentException(sprintf('The "From" number "%s" is not a valid phone number. Phone number must be in E.164 format.', $options['from']['phoneNumber'] ?? ''));
63+
throw new InvalidArgumentException(\sprintf('The "From" number "%s" is not a valid phone number. Phone number must be in E.164 format.', $options['from']['phoneNumber'] ?? ''));
6464
}
6565

66-
$endpoint = sprintf('https://%s/restapi/v1.0/account/~/extension/~/sms', $this->getEndpoint());
66+
$endpoint = \sprintf('https://%s/restapi/v1.0/account/~/extension/~/sms', $this->getEndpoint());
6767
$response = $this->client->request('POST', $endpoint, [
6868
'auth_bearer' => $this->apiToken,
6969
'json' => array_filter($options),
@@ -77,7 +77,7 @@ protected function doSend(MessageInterface $message): SentMessage
7777

7878
if (200 !== $statusCode) {
7979
$error = $response->toArray(false);
80-
throw new TransportException(sprintf('Unable to send the SMS - "%s".', $error['message'] ?? $error['error_description'] ?? $error['description'] ?? 'unknown failure'), $response);
80+
throw new TransportException(\sprintf('Unable to send the SMS - "%s".', $error['message'] ?? $error['error_description'] ?? $error['description'] ?? 'unknown failure'), $response);
8181
}
8282

8383
$success = $response->toArray(false);

Tests/RingCentralTransportTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ public function testInvalidArgumentExceptionIsThrownIfFromIsInvalid(string $from
4949
$transport = $this->createTransport(null, $from);
5050

5151
$this->expectException(InvalidArgumentException::class);
52-
$this->expectExceptionMessage(sprintf('The "From" number "%s" is not a valid phone number.', $from));
52+
$this->expectExceptionMessage(\sprintf('The "From" number "%s" is not a valid phone number.', $from));
5353

5454
$transport->send(new SmsMessage('+33612345678', 'Hello!'));
5555
}

0 commit comments

Comments
 (0)