1
0
Fork 0
mirror of https://github.com/archtechx/tenancy.git synced 2025-12-12 14:14:04 +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

@ -62,13 +62,8 @@ class TenancyServiceProvider extends ServiceProvider
{
foreach ($this->events() as $event => $listeners) {
foreach (array_unique($listeners) as $listener) {
// Technically, the string|Closure typehint is not enforced by
// Laravel, but for type correctness, we wrap callables in
// simple Closures, to match Laravel's docblock typehint.
if (is_callable($listener) && !$listener instanceof Closure) {
$listener = function ($event) use ($listener) {
$listener($event);
};
if ($listener instanceof JobPipeline) {
$listener = $listener->toClosure();
}
Event::listen($event, $listener);