1
0
Fork 0
mirror of https://github.com/archtechx/tenancy.git synced 2025-12-12 22:34:03 +00:00

Fix event listener tests, improve domain logic

This commit is contained in:
Samuel Štancl 2020-05-09 02:49:08 +02:00
parent 0bbc66f451
commit a602cec940
13 changed files with 148 additions and 14 deletions

View file

@ -8,8 +8,18 @@ abstract class QueueableListener implements ShouldQueue
{
public static $shouldQueue = false;
public function shouldQueue()
abstract public function handle();
public function shouldQueue($event)
{
return static::$shouldQueue;
if (static::$shouldQueue) {
return true;
} else {
// The listener is not queued so we manually
// pass the event to the handle() method.
$this->handle($event);
return false;
}
}
}