Skip to content

Commit 6ad9d50

Browse files
committed
refactor: disambiguate scheme classes
1 parent 0590193 commit 6ad9d50

File tree

8 files changed

+15
-15
lines changed

8 files changed

+15
-15
lines changed

packages/mailer/src/Transports/Postmark/PostmarkConfig.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,8 @@ final class PostmarkConfig implements MailerConfig
1818
{
1919
public string $transport {
2020
get => match ($this->sceme) {
21-
Scheme::API => PostmarkApiTransport::class,
22-
Scheme::SMTP => PostmarkSmtpTransport::class,
21+
PostmarkConnectionScheme::API => PostmarkApiTransport::class,
22+
PostmarkConnectionScheme::SMTP => PostmarkSmtpTransport::class,
2323
};
2424
}
2525

@@ -47,13 +47,13 @@ public function __construct(
4747
/**
4848
* Whether to use Postmark's API or SMTP server.
4949
*/
50-
public Scheme $scheme = Scheme::API,
50+
public PostmarkConnectionScheme $scheme = PostmarkConnectionScheme::API,
5151
) {}
5252

5353
public function createTransport(): TransportInterface
5454
{
5555
return new PostmarkTransportFactory()->create(new Dsn(
56-
scheme: Scheme::API->value,
56+
scheme: PostmarkConnectionScheme::API->value,
5757
user: $this->key,
5858
host: $this->host ?? 'default',
5959
port: $this->port,

packages/mailer/src/Transports/Postmark/Scheme.php renamed to packages/mailer/src/Transports/Postmark/PostmarkConnectionScheme.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
namespace Tempest\Mail\Transports\Postmark;
44

5-
enum Scheme: string
5+
enum PostmarkConnectionScheme: string
66
{
77
/**
88
* Use Postmark's API.

packages/mailer/src/Transports/Ses/Scheme.php renamed to packages/mailer/src/Transports/Ses/SesConnectionScheme.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
namespace Tempest\Mail\Transports\Ses;
44

5-
enum Scheme: string
5+
enum SesConnectionScheme: string
66
{
77
/**
88
* Uses Amazon SES's API.

packages/mailer/src/Transports/Ses/SesMailerConfig.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,8 @@ final class SesMailerConfig implements MailerConfig
2020
{
2121
public string $transport {
2222
get => match ($this->sceme) {
23-
Scheme::API => SesApiAsyncAwsTransport::class,
24-
Scheme::HTTP => SesHttpAsyncAwsTransport::class,
23+
SesConnectionScheme::API => SesApiAsyncAwsTransport::class,
24+
SesConnectionScheme::HTTP => SesHttpAsyncAwsTransport::class,
2525
};
2626
}
2727

@@ -59,7 +59,7 @@ public function __construct(
5959
/**
6060
* Whether to use Amazon SES's API or async HTTP transport.
6161
*/
62-
public Scheme $scheme = Scheme::HTTP,
62+
public SesConnectionScheme $scheme = SesConnectionScheme::HTTP,
6363
) {}
6464

6565
public function createTransport(): TransportInterface

packages/mailer/src/Transports/Ses/SesSmtpMailerConfig.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ public function __construct(
5454
/**
5555
* Whether to use Amazon SES's API or SMTP server.
5656
*/
57-
public Scheme $scheme = Scheme::API,
57+
public SesConnectionScheme $scheme = SesConnectionScheme::API,
5858
) {}
5959

6060
public function createTransport(): TransportInterface

packages/mailer/src/Transports/Smtp/SmtpMailerConfig.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ public function __construct(
2121
/**
2222
* Scheme used for this connection.
2323
*/
24-
public Scheme $scheme,
24+
public SmtpScheme $scheme,
2525

2626
/**
2727
* Host used for connecting to the SMTP server.

packages/mailer/src/Transports/Smtp/Scheme.php renamed to packages/mailer/src/Transports/Smtp/SmtpScheme.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
namespace Tempest\Mail\Transports\Smtp;
44

5-
enum Scheme: string
5+
enum SmtpScheme: string
66
{
77
case SMTP = 'smtp';
88
case SMTPS = 'smtps';

packages/mailer/src/mailer.config.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
<?php
22

3-
use Tempest\Mail\Transports\Smtp\Scheme;
43
use Tempest\Mail\Transports\Smtp\SmtpMailerConfig;
4+
use Tempest\Mail\Transports\Smtp\SmtpScheme;
55

66
return new SmtpMailerConfig(
77
scheme: match (strtolower(env('MAILER_SMTP_SCHEME', default: 'smtp'))) {
8-
'smtps' => Scheme::SMTPS,
9-
'smtp' => Scheme::SMTP,
8+
'smtps' => SmtpScheme::SMTPS,
9+
'smtp' => SmtpScheme::SMTP,
1010
},
1111
host: env('MAILER_SMTP_HOST', default: '127.0.0.0'),
1212
port: env('MAILER_SMTP_PORT', default: 2525),

0 commit comments

Comments
 (0)