Skip to content

Commit

Permalink
refactor: add Closure return type #1184
Browse files Browse the repository at this point in the history
  • Loading branch information
spiralbot committed Jan 3, 2025
1 parent c2b4575 commit a5044a5
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion tests/JobTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ private function getEmail(): Email
private function expectRenderer(Email $email): void
{
$this->renderer->expects('render')->withArgs(
function (Message $message) {
function (Message $message): bool {
$this->assertSame($message->getSubject(), 'test');
return true;
}
Expand Down
2 changes: 1 addition & 1 deletion tests/JobsQueueTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ public function testQueue(): void
$mail->setBCC('admin2@google.com');

$queue->expects('push')->withArgs(
function ($job, $data, Options $options) use ($mail) {
function ($job, $data, Options $options) use ($mail): bool {
$this->assertSame(MailQueue::JOB_NAME, $job);
$this->assertSame($data, MessageSerializer::pack($mail));
$this->assertSame('mailer', $options->getQueue());
Expand Down
8 changes: 4 additions & 4 deletions tests/QueueTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ public function testQueue(): void
$mail->setBCC('admin2@google.com');

$this->queue->expects('push')->withArgs(
function ($job, $data, Options $options) use ($mail) {
function ($job, $data, Options $options) use ($mail): bool {
$this->assertSame(MailQueue::JOB_NAME, $job);
$this->assertSame($data, MessageSerializer::pack($mail));
$this->assertSame('mailer', $options->getQueue());
Expand All @@ -68,21 +68,21 @@ public function testQueueWithDelay(): void
$mail3->setDelay(200);

$this->queue->expects('push')->once()->withArgs(
function ($job, $data, Options $options) {
function ($job, $data, Options $options): bool {
$this->assertSame(30, $options->getDelay());
return true;
}
);

$this->queue->expects('push')->once()->withArgs(
function ($job, $data, Options $options) {
function ($job, $data, Options $options): bool {
$this->assertSame(100, $options->getDelay());
return true;
}
);

$this->queue->expects('push')->once()->withArgs(
function ($job, $data, Options $options) {
function ($job, $data, Options $options): bool {
$this->assertSame(200, $options->getDelay());
return true;
}
Expand Down

0 comments on commit a5044a5

Please sign in to comment.