Skip to content

Commit 2fac69d

Browse files
committed
Merge branch '3.x' of github.com:BinarCode/laravel-mailator into 3.x
2 parents ad77c86 + 71d2ec6 commit 2fac69d

File tree

2 files changed

+14
-16
lines changed

2 files changed

+14
-16
lines changed

src/Models/MailatorSchedule.php

Lines changed: 14 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22

33
namespace Binarcode\LaravelMailator\Models;
44

5-
use App\Domains\ResultDocuments\Models\ResultDocument;
65
use Binarcode\LaravelMailator\Actions\Action;
76
use Binarcode\LaravelMailator\Actions\ResolveGarbageAction;
87
use Binarcode\LaravelMailator\Actions\RunSchedulersAction;
@@ -106,8 +105,8 @@ public function mailable(Mailable $mailable): self
106105
{
107106
if ($mailable instanceof Constraintable) {
108107
collect($mailable->constraints())
109-
->filter(fn($constraint) => $constraint instanceof SendScheduleConstraint)
110-
->each(fn(SendScheduleConstraint $constraint) => $this->constraint($constraint));
108+
->filter(fn ($constraint) => $constraint instanceof SendScheduleConstraint)
109+
->each(fn (SendScheduleConstraint $constraint) => $this->constraint($constraint));
111110
}
112111

113112
$this->mailable_class = serialize($mailable);
@@ -318,7 +317,7 @@ public function recipients(...$recipients): self
318317
{
319318
$this->recipients = array_merge(collect($recipients)
320319
->flatten()
321-
->filter(fn($email) => $this->ensureValidEmail($email))
320+
->filter(fn ($email) => $this->ensureValidEmail($email))
322321
->unique()
323322
->toArray(), $this->recipients ?? []);
324323

@@ -344,15 +343,15 @@ public function shouldSend(): bool
344343
try {
345344
$this->load('logs');
346345

347-
if (!$this->configurationsPasses()) {
346+
if (! $this->configurationsPasses()) {
348347
return false;
349348
}
350349

351-
if (!$this->whenPasses()) {
350+
if (! $this->whenPasses()) {
352351
return false;
353352
}
354353

355-
if (!$this->eventsPasses()) {
354+
if (! $this->eventsPasses()) {
356355
if ($this->isStopable()) {
357356
$this->markComplete();
358357
}
@@ -409,7 +408,7 @@ public static function run(): void
409408

410409
public function hasCustomAction(): bool
411410
{
412-
return !is_null($this->action);
411+
return ! is_null($this->action);
413412
}
414413

415414
public function getMailable(): ?Mailable
@@ -464,13 +463,13 @@ public function markAsFailed(string $failureReason): self
464463
public function getRecipients(): array
465464
{
466465
return collect($this->recipients)
467-
->filter(fn($email) => $this->ensureValidEmail($email))
466+
->filter(fn ($email) => $this->ensureValidEmail($email))
468467
->toArray();
469468
}
470469

471470
protected function ensureValidEmail(string $email): bool
472471
{
473-
return !Validator::make(
472+
return ! Validator::make(
474473
compact('email'),
475474
['email' => 'required|email']
476475
)->fails();
@@ -483,7 +482,7 @@ public function actionClass(Action $action): self
483482
return $this;
484483
}
485484

486-
public function tag(string|array $tag): self
485+
public function tag(string | array $tag): self
487486
{
488487
if (is_array($tag)) {
489488
$tag = implode(',', $tag);
@@ -534,7 +533,7 @@ public function markComplete(): self
534533

535534
public function isCompleted(): bool
536535
{
537-
return !is_null($this->completed_at);
536+
return ! is_null($this->completed_at);
538537
}
539538

540539
public function failedLastTimes(int $times): bool
@@ -556,12 +555,12 @@ public function timestampTarget(): ?CarbonInterface
556555

557556
public function isRepetitive(): bool
558557
{
559-
return !$this->isOnce();
558+
return ! $this->isOnce();
560559
}
561560

562561
public function wasSentOnce(): bool
563562
{
564-
return !is_null($this->last_sent_at);
563+
return ! is_null($this->last_sent_at);
565564
}
566565

567566
public function getConstraints(): ConstraintsCollection
@@ -571,7 +570,7 @@ public function getConstraints(): ConstraintsCollection
571570

572571
public function save(array $options = [])
573572
{
574-
if (!$this->isUnique()) {
573+
if (! $this->isUnique()) {
575574
return parent::save($options);
576575
}
577576

tests/Feature/UniqueSchedulerTest.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44

55
use Binarcode\LaravelMailator\Scheduler;
66
use Binarcode\LaravelMailator\Tests\database\Factories\UserFactory;
7-
use Binarcode\LaravelMailator\Tests\Fixtures\Constraints\DynamicContraint;
87
use Binarcode\LaravelMailator\Tests\Fixtures\InvoiceReminderMailable;
98
use Binarcode\LaravelMailator\Tests\TestCase;
109
use Illuminate\Support\Facades\Mail;

0 commit comments

Comments
 (0)