mirror of
https://github.com/archtechx/tenancy.git
synced 2025-12-12 23:14:03 +00:00
Simplify reduce
This commit is contained in:
parent
09412cd7ad
commit
7bc58f3980
1 changed files with 1 additions and 3 deletions
|
|
@ -435,9 +435,7 @@ class TenantManager
|
||||||
public function event(string $name, &...$args): array
|
public function event(string $name, &...$args): array
|
||||||
{
|
{
|
||||||
return array_reduce($this->eventListeners[$name] ?? [], function ($results, $listener) use ($args) {
|
return array_reduce($this->eventListeners[$name] ?? [], function ($results, $listener) use ($args) {
|
||||||
$results = array_merge($results, $listener($this, ...$args) ?? []);
|
return array_merge($results, $listener($this, ...$args) ?? []);
|
||||||
|
|
||||||
return $results;
|
|
||||||
}, []);
|
}, []);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue