Skip to content

Commit

Permalink
lint fix
Browse files Browse the repository at this point in the history
  • Loading branch information
fanatic75 committed Nov 28, 2023
1 parent 7a1a3e7 commit fce54a6
Show file tree
Hide file tree
Showing 7 changed files with 20 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/Utopia/Messaging/Adapter.php
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ public function send(Message $message): string
* @param string $url The URL to send the request to.
* @param array<string> $headers An array of headers to send with the request.
* @param string|null $body The body of the request.
* @return array The response body.
* @return array<string, mixed> The response body.
*/
protected function request(
string $method,
Expand Down
1 change: 1 addition & 0 deletions src/Utopia/Messaging/Adapter/Push/FCM.php
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,7 @@ protected function process(PushMessage $message): string
match ($item['error']) {
'Invalid JSON' => 'Bad Request.',
'Invalid Parameters' => 'Bad Request.',
'default' => null,
},
);
} elseif ($result['statusCode'] === 401) {
Expand Down
2 changes: 1 addition & 1 deletion src/Utopia/Messaging/Adapter/SMS.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ public function getMessageType(): string
* Send an SMS message.
*
* @param SMSMessage $message Message to send.
* @return array The response body.
* @return string The response body.
*/
abstract protected function process(SMSMessage $message): string;
}
3 changes: 3 additions & 0 deletions src/Utopia/Messaging/Messages/Push.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,9 @@ public function __construct(
) {
}

/**
* @return array<string>
*/
public function getTo(): array
{
return $this->to;
Expand Down
11 changes: 10 additions & 1 deletion src/Utopia/Messaging/Response.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@ class Response

private string $type;

/**
* @var array<string, string>
*/
private array $details;

public function __construct(string $type)
Expand Down Expand Up @@ -51,16 +54,22 @@ public function addToDetails(string $recipient, string $error = ''): void
];
}

public function popFromDetails()
public function popFromDetails(): void
{
array_pop($this->details);
}

/**
* @return array<string, string>
*/
public function getDetails(): array
{
return $this->details;
}

/**
* @return array<string, mixed>
*/
public function toArray(): array
{
return [
Expand Down
3 changes: 3 additions & 0 deletions tests/Messaging/Adapter/Base.php
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,9 @@ protected function getLastEmail(): array
return [];
}

/**
* @param array<string, mixed> $response
*/
protected function assertResponse(array $response): void
{
$this->assertEquals(1, $response['deliveredTo']);
Expand Down
2 changes: 1 addition & 1 deletion tests/Messaging/Adapter/SMS/Msg91Test.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

class Msg91Test extends Base
{
public function testSendSMS()
public function testSendSMS(): void
{
$sender = new Msg91(getenv('MSG_91_SENDER_ID'), getenv('MSG_91_AUTH_KEY'), getenv('MSG_91_TEMPLATE_ID'));

Expand Down

0 comments on commit fce54a6

Please sign in to comment.