Skip to content

Commit

Permalink
Lint
Browse files Browse the repository at this point in the history
  • Loading branch information
abnegate committed Nov 2, 2023
1 parent aa635f1 commit 327acfd
Show file tree
Hide file tree
Showing 16 changed files with 106 additions and 114 deletions.
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"license": "MIT",
"minimum-stability": "stable",
"scripts": {
"test": "vendor/bin/phpunit",
"test": "./vendor/bin/phpunit",
"lint": "./vendor/bin/pint --test",
"format": "./vendor/bin/pint",
"analyse": "./vendor/bin/phpstan analyse --memory-limit=2G --level=6 src tests"
Expand Down
167 changes: 85 additions & 82 deletions composer.lock

Large diffs are not rendered by default.

5 changes: 3 additions & 2 deletions src/Utopia/Messaging/Adapter/Push/APNS.php
Original file line number Diff line number Diff line change
Expand Up @@ -60,9 +60,10 @@ public function process(Push $message): string
}

/**
* @param array<string> $to
* @param array<string, mixed> $payload
* @param array<string> $to
* @param array<string, mixed> $payload
* @return array<string, mixed>
*
* @throws Exception
*/
private function notify(array $to, array $payload): array
Expand Down
3 changes: 1 addition & 2 deletions src/Utopia/Messaging/Adapter/SMS/Telesign.php
Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,7 @@ protected function process(SMS $message): string
}

/**
* @param array<string> $numbers
* @return string
* @param array<string> $numbers
*/
private function formatNumbers(array $numbers): string
{
Expand Down
16 changes: 4 additions & 12 deletions src/Utopia/Messaging/Messages/Discord.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,18 +7,10 @@
class Discord implements Message
{
/**
* @param string $content
* @param string|null $username
* @param string|null $avatarUrl
* @param bool|null $tts
* @param array<string, mixed>|null $embeds
* @param array<string, mixed>|null $allowedMentions
* @param array<string, mixed>|null $components
* @param array<string, mixed>|null $attachments
* @param string|null $flags
* @param string|null $threadName
* @param bool|null $wait
* @param string|null $threadId
* @param array<string, mixed>|null $embeds
* @param array<string, mixed>|null $allowedMentions
* @param array<string, mixed>|null $components
* @param array<string, mixed>|null $attachments
*/
public function __construct(
private string $content,
Expand Down
1 change: 0 additions & 1 deletion src/Utopia/Messaging/Messages/Email.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@

class Email implements Message
{

/**
* @param array<string> $to The recipients of the email.
* @param string $subject The subject of the email.
Expand Down
6 changes: 2 additions & 4 deletions src/Utopia/Messaging/Messages/SMS.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,8 @@
class SMS implements Message
{
/**
* @param array<string> $to
* @param string $content
* @param string|null $from
* @param array<string>|null $attachments
* @param array<string> $to
* @param array<string>|null $attachments
*/
public function __construct(
private array $to,
Expand Down
4 changes: 2 additions & 2 deletions tests/Messaging/Adapter/App/DiscordTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@

namespace Utopia\Tests\Adapter\App;

use Utopia\Tests\Adapter\Base;
use Utopia\Messaging\Adapter\App\Discord;
use Utopia\Messaging\Messages\Discord as DiscordMessage;
use Utopia\Tests\Adapter\Base;

class DiscordTest extends Base
{
Expand All @@ -30,4 +30,4 @@ public function testSendMessage(): void
$this->assertNotEmpty($result);
$this->assertNotEmpty($result['id']);
}
}
}
2 changes: 1 addition & 1 deletion tests/Messaging/Adapter/Email/EmailTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@

namespace Utopia\Tests\Adapter\Email;

use Utopia\Tests\Adapter\Base;
use Utopia\Messaging\Adapter\Email\Mock;
use Utopia\Messaging\Messages\Email;
use Utopia\Tests\Adapter\Base;

class EmailTest extends Base
{
Expand Down
2 changes: 1 addition & 1 deletion tests/Messaging/Adapter/Email/MailgunTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@

namespace Utopia\Tests\Adapter\Email;

use Utopia\Tests\Adapter\Base;
use Utopia\Messaging\Adapter\Email\Mailgun;
use Utopia\Messaging\Messages\Email;
use Utopia\Tests\Adapter\Base;

class MailgunTest extends Base
{
Expand Down
2 changes: 1 addition & 1 deletion tests/Messaging/Adapter/Email/SendgridTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@

namespace Utopia\Tests\Adapter\Email;

use Utopia\Tests\Adapter\Base;
use Utopia\Messaging\Adapter\Email\Sendgrid;
use Utopia\Messaging\Messages\Email;
use Utopia\Tests\Adapter\Base;

class SendgridTest extends Base
{
Expand Down
2 changes: 1 addition & 1 deletion tests/Messaging/Adapter/Push/APNSTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@

namespace Utopia\Tests\Adapter\Push;

use Utopia\Tests\Adapter\Base;
use Utopia\Messaging\Adapter\Push\APNS as APNSAdapter;
use Utopia\Messaging\Messages\Push;
use Utopia\Tests\Adapter\Base;

class APNSTest extends Base
{
Expand Down
2 changes: 1 addition & 1 deletion tests/Messaging/Adapter/Push/FCMTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@

namespace Utopia\Tests\Adapter\Push;

use Utopia\Tests\Adapter\Base;
use Utopia\Messaging\Adapter\Push\FCM as FCMAdapter;
use Utopia\Messaging\Messages\Push;
use Utopia\Tests\Adapter\Base;

class FCMTest extends Base
{
Expand Down
2 changes: 1 addition & 1 deletion tests/Messaging/Adapter/SMS/SMSTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@

namespace Utopia\Tests\Adapter\SMS;

use Utopia\Tests\Adapter\Base;
use Utopia\Messaging\Adapter\SMS\Mock;
use Utopia\Messaging\Messages\SMS;
use Utopia\Tests\Adapter\Base;

class SMSTest extends Base
{
Expand Down
2 changes: 1 addition & 1 deletion tests/Messaging/Adapter/SMS/TwilioTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@

namespace Utopia\Tests\Adapter\SMS;

use Utopia\Tests\Adapter\Base;
use Utopia\Messaging\Adapter\SMS\Twilio;
use Utopia\Messaging\Messages\SMS;
use Utopia\Tests\Adapter\Base;

class TwilioTest extends Base
{
Expand Down
2 changes: 1 addition & 1 deletion tests/Messaging/Adapter/SMS/VonageTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@

namespace Utopia\Tests\Adapter\SMS;

use Utopia\Tests\Adapter\Base;
use Utopia\Messaging\Adapter\SMS\Vonage;
use Utopia\Messaging\Messages\SMS;
use Utopia\Tests\Adapter\Base;

class VonageTest extends Base
{
Expand Down

0 comments on commit 327acfd

Please sign in to comment.