mirror of
https://github.com/archtechx/tenancy.git
synced 2025-12-12 14:14:04 +00:00
JobPipeline tests
This commit is contained in:
parent
bd9aad229b
commit
7a2e6bb13e
4 changed files with 108 additions and 12 deletions
|
|
@ -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);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue