22
33namespace Binarcode \LaravelMailator \Models ;
44
5- use App \Domains \ResultDocuments \Models \ResultDocument ;
65use Binarcode \LaravelMailator \Actions \Action ;
76use Binarcode \LaravelMailator \Actions \ResolveGarbageAction ;
87use 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
0 commit comments