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

JobPipeline tests

This commit is contained in:
Samuel Štancl 2020-05-08 05:12:46 +02:00
parent bd9aad229b
commit 7a2e6bb13e
4 changed files with 108 additions and 12 deletions

View file

@ -2,6 +2,7 @@
namespace Stancl\Tenancy\Events\Listeners;
use Closure;
use Illuminate\Contracts\Queue\ShouldQueue;
use Illuminate\Pipeline\Pipeline;
@ -71,4 +72,20 @@ class JobPipeline implements ShouldQueue
->through($this->jobs)
->thenReturn();
}
/**
* Generate a closure that runs this listener.
*
* Technically, the string|Closure typehint is not enforced by
* Laravel, but for correct typing we wrap this callable in
* simple Closures, to match Laravel's docblock typehint.
*
* @return Closure
*/
public function toClosure(): Closure
{
return function (...$args) {
$this->handle(...$args);
};
}
}