8000 fabbot commits · symfony/symfony@3b58f41 · GitHub
[go: up one dir, main page]

Skip to content

Commit 3b58f41

Browse files
committed
fabbot commits
1 parent eeb2efe commit 3b58f41

File tree

5 files changed

+16
-10
lines changed

5 files changed

+16
-10
lines changed

src/Symfony/Component/Notifier/Bridge/Plivo/PlivoOptions.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
<?php
2+
23
/*
34
* This file is part of the Symfony package.
45
*

src/Symfony/Component/Notifier/Bridge/Plivo/PlivoTransport.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
<?php
2+
23
/*
34
* This file is part of the Symfony package.
45
*
@@ -66,7 +67,7 @@ protected function doSend(MessageInterface $message): SentMessage
6667
}
6768

6869
$endpoint = sprintf('https://%s/v1/Account/%s/Message/', $this->getEndpoint(), $this->authId);
69-
$response = $this->client->request('POST', $endpoint,['auth_basic' => $this->authId.':'.$this->authToken, 'json' => array_filter($options)]);
70+
$response = $this->client->request('POST', $endpoint, ['auth_basic' => $this->authId.':'.$this->authToken, 'json' => array_filter($options)]);
7071

7172
try {
7273
$statusCode = $response->getStatusCode();
@@ -80,7 +81,7 @@ protected function doSend(MessageInterface $message): SentMessage
8081
} catch (JsonException) {
8182
$error['error'] = $response->getContent(false);
8283
}
83-
throw new TransportException(sprintf('Unable to send the SMS - status code: %s: %s', $statusCode, $error['error'] ?? 'unknown error'), $response);
84+
throw new TransportException(sprintf('Unable to send the SMS - status code: "%s": "%s".', $statusCode, $error['error'] ?? 'unknown error'), $response);
8485
}
8586

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

src/Symfony/Component/Notifier/Bridge/Plivo/PlivoTransportFactory.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
<?php
2+
23
/*
34
* This file is part of the Symfony package.
45
*

src/Symfony/Component/Notifier/Bridge/Plivo/Tests/PlivoTransportFactoryTest.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
<?php
2+
23
/*
34
* This file is part of the Symfony package.
45
*

src/Symfony/Component/Notifier/Bridge/Plivo/Tests/PlivoTransportTest.php

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
<?php
2+
23
/*
34
* This file is part of the Symfony package.
45
*
@@ -22,7 +23,8 @@
2223

2324
final class PlivoTransportTest extends TransportTestCase
2425
{
25-
public function createTransport(HttpClientInterface $client = null, string $from = 'from'): PlivoTransport {
26+
public function createTransport(HttpClientInterface $client = null, string $from = 'from'): PlivoTransport
27+
{
2628
return new PlivoTransport('authId', 'authToken', $from, $client ?? $this->createMock(HttpClientInterface::class));
2729
}
2830

@@ -42,7 +44,7 @@ public function supportedMessagesProvider(): iterable
4244
/**
4345
* @dataProvider invalidFromProvider
4446
*/
45-
public function testInvalidArgumentExceptionIsThrownIfFromIsInvalid(string $from): void
47+
public function testInvalidArgumentExceptionIsThrownIfFromIsInvalid(string $from)
4648
{
4749
$transport = $this->createTransport(null, $from);
4850

@@ -55,18 +57,18 @@ public function testInvalidArgumentExceptionIsThrownIfFromIsInvalid(string $from
5557
/**
5658
* @dataProvider validFromProvider
5759
*/
58-
public function testNoInvalidArgumentExceptionIsThrownIfFromIsValid(string $from): void
60+
public function testNoInvalidArgumentExceptionIsThrownIfFromIsValid(string $from)
5961
{
6062
$message = new SmsMessage('+33612345678', 'Hello!');
6163
$response = $this->createMock(ResponseInterface::class);
6264
$response->expects(self::exactly(2))->method('getStatusCode')->willReturn(202);
63-
$response->expects(self::once())->method('getContent')->willReturn(json_encode(['message' => 'message(s) queued', 'message_uuid' => ['foo'], 'api_id' => 'bar',]));
65+
$response->expects(self::once())->method('getContent')->willReturn(json_encode(['message' => 'message(s) queued', 'message_uuid' => ['foo'], 'api_id' => 'bar']));
6466
$client = new MockHttpClient(function (string $method, string $url) use ($response): ResponseInterface {
65-
self::assertSame('POST', $method);
66-
self::assertSame('https://api.plivo.com/v1/Account/authId/Message/', $url);
67+
self::assertSame('POST', $method);
68+
self::assertSame('https://api.plivo.com/v1/Account/authId/Message/', $url);
6769

68-
return $response;
69-
}
70+
return $response;
71+
}
7072
);
7173
$transport = $this->createTransport($client, $from);
7274
$sentMessage = $transport->send($message);

0 commit comments

Comments
 (0)
0