Skip to content

Commit 13163e5

Browse files
committed
Add should queue interface
1 parent 9661ec0 commit 13163e5

2 files changed

Lines changed: 14 additions & 0 deletions

File tree

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
<?php
2+
3+
namespace Bow\Notifier;
4+
5+
interface NotifierShouldQueue
6+
{
7+
}

src/Notifier/WithNotifier.php

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

33
namespace Bow\Notifier;
44

5+
use Bow\Notifier\NotifierShouldQueue;
6+
57
trait WithNotifier
68
{
79
/**
@@ -12,6 +14,11 @@ trait WithNotifier
1214
*/
1315
public function sendMessage(Notifier $notifier): void
1416
{
17+
if (in_array(NotifierShouldQueue::class, class_implements($notifier))) {
18+
$this->setMessageQueue($notifier);
19+
return;
20+
}
21+
1522
$notifier->process($this);
1623
}
1724

0 commit comments

Comments
 (0)