Skip to content

Commit 4c77afc

Browse files
Merge pull request #65 from stackkit/master-next
Master next
2 parents b3bfb5d + 4044614 commit 4c77afc

14 files changed

+37
-39
lines changed

.github/workflows/run-tests.yml

+3-3
Original file line numberDiff line numberDiff line change
@@ -66,9 +66,9 @@ jobs:
6666
payload:
6767
- { laravel: '11.*', php: '8.3', 'testbench': '9.*', collision: '8.*' }
6868
- { laravel: '11.*', php: '8.2', 'testbench': '9.*', collision: '8.*' }
69-
- { laravel: '10.*', php: '8.3', 'testbench': '8.*', collision: '7.*' }
70-
- { laravel: '10.*', php: '8.2', 'testbench': '8.*', collision: '7.*' }
71-
- { laravel: '10.*', php: '8.1', 'testbench': '8.*', collision: '7.*' }
69+
- { laravel: '12.*', php: '8.2', 'testbench': '10.*', collision: '8.*' }
70+
- { laravel: '12.*', php: '8.3', 'testbench': '10.*', collision: '8.*' }
71+
- { laravel: '12.*', php: '8.4', 'testbench': '10.*', collision: '8.*' }
7272

7373
name: PHP ${{ matrix.payload.php }} - Laravel ${{ matrix.payload.laravel }} - DB ${{ matrix.db }}
7474

README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ This package allows you to store and send e-mails using the database.
88

99
# Requirements
1010

11-
This package requires Laravel 10 or 11.
11+
This package requires Laravel 11 or 12.
1212

1313
# Installation
1414

composer.json

+6-6
Original file line numberDiff line numberDiff line change
@@ -30,13 +30,13 @@
3030
},
3131
"require": {
3232
"ext-json": "*",
33-
"laravel/framework": "^10.0|^11.0",
34-
"doctrine/dbal": "^3.8"
33+
"laravel/framework": "^11.0|^12.0",
34+
"doctrine/dbal": "^4.0"
3535
},
3636
"require-dev": {
3737
"mockery/mockery": "^1.2",
38-
"orchestra/testbench": "^8.0|^9.0",
39-
"nunomaduro/collision": "^7.0|^8.0",
38+
"orchestra/testbench": "^9.0|^10.0",
39+
"nunomaduro/collision": "^8.0",
4040
"laravel/pint": "^1.14"
4141
},
4242
"minimum-stability": "dev",
@@ -45,8 +45,8 @@
4545
"l11": [
4646
"composer update laravel/framework:11.* orchestra/testbench:9.* nunomaduro/collision:8.* --with-all-dependencies"
4747
],
48-
"l10": [
49-
"composer update laravel/framework:10.* orchestra/testbench:8.* nunomaduro/collision:7.* --with-all-dependencies"
48+
"l12": [
49+
"composer update laravel/framework:12.* orchestra/testbench:10.* nunomaduro/collision:8.* --with-all-dependencies"
5050
],
5151
"test": [
5252
"testbench workbench:create-sqlite-db",

src/Email.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ class Email extends Model
5757

5858
public static function compose(): EmailComposer
5959
{
60-
return new EmailComposer(new static());
60+
return new EmailComposer(new static);
6161
}
6262

6363
public function isSent(): bool
@@ -99,7 +99,7 @@ public function markAsFailed(Throwable $exception): void
9999

100100
public function send(): void
101101
{
102-
(new Sender())->send($this);
102+
(new Sender)->send($this);
103103
}
104104

105105
public static function pruneWhen(Closure $closure): void

src/EmailComposer.php

+4-4
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ public function __construct(public Email $email)
4545
public function envelope(null|Envelope|Closure $envelope = null): self
4646
{
4747
if ($envelope instanceof Closure) {
48-
$this->envelope = $envelope($this->envelope ?: new Envelope());
48+
$this->envelope = $envelope($this->envelope ?: new Envelope);
4949

5050
return $this;
5151
}
@@ -58,7 +58,7 @@ public function envelope(null|Envelope|Closure $envelope = null): self
5858
public function content(null|Content|Closure $content = null): self
5959
{
6060
if ($content instanceof Closure) {
61-
$this->content = $content($this->content ?: new Content());
61+
$this->content = $content($this->content ?: new Content);
6262

6363
return $this;
6464
}
@@ -141,15 +141,15 @@ public function mailable(Mailable $mailable): self
141141
{
142142
$this->mailable = $mailable;
143143

144-
(new MailableReader())->read($this);
144+
(new MailableReader)->read($this);
145145

146146
return $this;
147147
}
148148

149149
public function send(): Email
150150
{
151151
if ($this->envelope && $this->content) {
152-
(new MailableReader())->read($this);
152+
(new MailableReader)->read($this);
153153
}
154154

155155
if (! is_array($this->email->from)) {

src/SentMessage.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ class SentMessage
2929

3030
public static function createFromSymfonyMailer(Email $email): SentMessage
3131
{
32-
$sentMessage = new self();
32+
$sentMessage = new self;
3333

3434
foreach ($email->getFrom() as $address) {
3535
$sentMessage->from[$address->getAddress()] = $address->getName();

src/Store.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ class Store
1717
*/
1818
public function getQueue(): LazyCollection
1919
{
20-
$query = new Email();
20+
$query = new Email;
2121

2222
return Email::query()
2323
->whereNull('deleted_at')

tests/ComposeTest.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ public function models_can_be_attached(): void
2525
->user($user)
2626
->model($user)
2727
->envelope(fn (Envelope $envelope) => $envelope->subject('Hey'))
28-
->content(fn (Content $content) => $content->view('welcome'))
28+
->content(fn (Content $content) => $content->view('tests::welcome'))
2929
->send();
3030

3131
$this->assertEquals($email->model_type, $user->getMorphClass());
@@ -44,7 +44,7 @@ public function models_can_be_empty(): void
4444
$email = Email::compose()
4545
->user($user)
4646
->envelope(fn (Envelope $envelope) => $envelope->subject('Hey'))
47-
->content(fn (Content $content) => $content->view('welcome'))
47+
->content(fn (Content $content) => $content->view('tests::welcome'))
4848
->send();
4949

5050
$this->assertNull($email->model_type);

tests/EnvelopeTest.php

+10-10
Original file line numberDiff line numberDiff line change
@@ -19,13 +19,13 @@ public function test_it_can_set_the_envelope()
1919
{
2020
$email = Email::compose()
2121
->envelope(
22-
(new Envelope())
22+
(new Envelope)
2323
->subject('Hey')
2424
2525
2626
)
2727
->content(
28-
(new Content())
28+
(new Content)
2929
->view('tests::dummy')
3030
->with(['name' => 'John Doe'])
3131
)
@@ -40,15 +40,15 @@ public function test_it_can_set_the_envelope()
4040
#[Test]
4141
public function test_it_can_pass_user_models()
4242
{
43-
$user = (new User())->forceFill([
43+
$user = (new User)->forceFill([
4444
'email' => '[email protected]',
4545
'name' => 'J. Doe',
4646
]);
4747

4848
$email = Email::compose()
4949
->user($user)
5050
->envelope(fn (Envelope $envelope) => $envelope->subject('Hey'))
51-
->content(fn (Content $content) => $content->view('welcome'))
51+
->content(fn (Content $content) => $content->view('tests::welcome'))
5252
->send();
5353

5454
$this->assertEquals(
@@ -62,15 +62,15 @@ public function test_it_can_pass_user_models()
6262
#[Test]
6363
public function users_can_have_a_preferred_email()
6464
{
65-
$user = (new UserWithPreferredEmail())->forceFill([
65+
$user = (new UserWithPreferredEmail)->forceFill([
6666
'email' => '[email protected]',
6767
'name' => 'J. Doe',
6868
]);
6969

7070
$email = Email::compose()
7171
->user($user)
7272
->envelope(fn (Envelope $envelope) => $envelope->subject('Hey'))
73-
->content(fn (Content $content) => $content->view('welcome'))
73+
->content(fn (Content $content) => $content->view('tests::welcome'))
7474
->send();
7575

7676
$this->assertEquals(
@@ -84,15 +84,15 @@ public function users_can_have_a_preferred_email()
8484
#[Test]
8585
public function users_can_have_a_preferred_name()
8686
{
87-
$user = (new UserWithPreferredName())->forceFill([
87+
$user = (new UserWithPreferredName)->forceFill([
8888
'email' => '[email protected]',
8989
'name' => 'J. Doe',
9090
]);
9191

9292
$email = Email::compose()
9393
->user($user)
9494
->envelope(fn (Envelope $envelope) => $envelope->subject('Hey'))
95-
->content(fn (Content $content) => $content->view('welcome'))
95+
->content(fn (Content $content) => $content->view('tests::welcome'))
9696
->send();
9797

9898
$this->assertEquals(
@@ -106,7 +106,7 @@ public function users_can_have_a_preferred_name()
106106
#[Test]
107107
public function users_can_have_a_preferred_locale()
108108
{
109-
$nonLocaleUser = (new User())->forceFill([
109+
$nonLocaleUser = (new User)->forceFill([
110110
'email' => '[email protected]',
111111
'name' => 'J. Doe',
112112
]);
@@ -117,7 +117,7 @@ public function users_can_have_a_preferred_locale()
117117
->content(fn (Content $content) => $content->view('locale-email'))
118118
->send();
119119

120-
$localeUser = (new UserWithPreferredLocale())->forceFill([
120+
$localeUser = (new UserWithPreferredLocale)->forceFill([
121121
'email' => '[email protected]',
122122
'name' => 'J. Doe',
123123
]);

tests/MailableReaderTest.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ class MailableReaderTest extends TestCase
1414
{
1515
private function mailable(): Mailable
1616
{
17-
return new TestMailable();
17+
return new TestMailable;
1818
}
1919

2020
#[Test]

tests/SenderTest.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ class SenderTest extends TestCase
1717
/** @var array<SentMessage> */
1818
public $sent = [];
1919

20-
public function setUp(): void
20+
protected function setUp(): void
2121
{
2222
parent::setUp();
2323

tests/TestCase.php

+3-4
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ class TestCase extends \Orchestra\Testbench\TestCase
1616
use RefreshDatabase;
1717
use WithWorkbench;
1818

19-
public function setUp(): void
19+
protected function setUp(): void
2020
{
2121
parent::setUp();
2222

@@ -26,10 +26,9 @@ public function setUp(): void
2626
1,
2727
1.0,
2828
'test',
29-
new \stdClass(),
29+
new \stdClass,
3030
(object) [],
31-
function () {
32-
},
31+
function () {},
3332
];
3433

3534
view()->addNamespace('tests', __DIR__.'/views');

tests/views/welcome.blade.php

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Welcome

workbench/app/Models/User.php

+1-3
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,4 @@
66

77
use Illuminate\Foundation\Auth\User as UserAlias;
88

9-
class User extends UserAlias
10-
{
11-
}
9+
class User extends UserAlias {}

0 commit comments

Comments
 (0)