Skip to content

Commit c5a14c0

Browse files
style: convert all docblocks to inline comments as requested
1 parent c93d310 commit c5a14c0

2 files changed

Lines changed: 11 additions & 42 deletions

File tree

src/Utopia/Messaging/Adapter/SMS/VonageMessages.php

Lines changed: 9 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -6,50 +6,34 @@
66
use Utopia\Messaging\Messages\SMS as SMSMessage;
77
use Utopia\Messaging\Response;
88

9-
/**
10-
* Vonage Messages API SMS Adapter.
11-
*
12-
* This adapter uses the modern Vonage Messages API (V1) which is more cost-effective
13-
* and versatile than the legacy SMS API.
14-
*
15-
* @link https://developer.vonage.com/en/api/messages
16-
*/
9+
// Vonage Messages API SMS Adapter.
10+
// This adapter uses the modern Vonage Messages API (V1) which is more cost-effective
11+
// and versatile than the legacy SMS API.
12+
// https://developer.vonage.com/en/api/messages
1713
class VonageMessages extends SMSAdapter
1814
{
1915
protected const NAME = 'Vonage Messages';
2016

21-
/**
22-
* @param string $apiKey Vonage API Key
23-
* @param string $apiSecret Vonage API Secret
24-
*/
2517
public function __construct(
2618
private string $apiKey,
2719
private string $apiSecret,
2820
private ?string $from = null
2921
) {
3022
}
3123

32-
/**
33-
* Vonage Messages API endpoint.
34-
*/
24+
// Vonage Messages API endpoint.
3525
protected function getApiEndpoint(): string
3626
{
3727
return 'https://api.vonage.com/v1/messages';
3828
}
3929

40-
/**
41-
* Generates the Basic Authorization header.
42-
*/
30+
// Generates the Basic Authorization header.
4331
protected function getAuthorizationHeader(): string
4432
{
4533
return 'Basic ' . \base64_encode("{$this->apiKey}:{$this->apiSecret}");
4634
}
4735

48-
/**
49-
* Sets common headers for the API request.
50-
*
51-
* @return array<string>
52-
*/
36+
// Sets common headers for the API request.
5337
protected function getRequestHeaders(): array
5438
{
5539
return [
@@ -60,25 +44,18 @@ protected function getRequestHeaders(): array
6044
];
6145
}
6246

63-
/**
64-
* Get adapter name.
65-
*/
47+
// Get adapter name.
6648
public function getName(): string
6749
{
6850
return static::NAME;
6951
}
7052

71-
/**
72-
* Get max messages per request.
73-
*/
53+
// Get max messages per request.
7454
public function getMaxMessagesPerRequest(): int
7555
{
7656
return 1;
7757
}
7858

79-
/**
80-
* {@inheritdoc}
81-
*/
8259
protected function process(SMSMessage $message): array
8360
{
8461
$to = \ltrim($message->getTo()[0], '+');

tests/Messaging/Adapter/SMS/VonageMessagesTest.php

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,7 @@
88

99
class VonageMessagesTest extends Base
1010
{
11-
/**
12-
* Tests sending an SMS with the 'from' number set directly in the adapter.
13-
*
14-
* @throws \Exception
15-
*/
11+
// Tests sending an SMS with the 'from' number set directly in the adapter.
1612
public function testSendSMS(): void
1713
{
1814
$apiKey = \getenv('VONAGE_API_KEY');
@@ -39,11 +35,7 @@ public function testSendSMS(): void
3935
$this->assertResponse($response);
4036
}
4137

42-
/**
43-
* Tests sending an SMS where the 'from' number is provided by the message object.
44-
*
45-
* @throws \Exception
46-
*/
38+
// Tests sending an SMS where the 'from' number is provided by the message object.
4739
public function testSendSMSWithFallbackFrom(): void
4840
{
4941
$apiKey = \getenv('VONAGE_API_KEY');

0 commit comments

Comments
 (0)