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

Simplify reduce

This commit is contained in:
Samuel Štancl 2019-10-28 21:00:34 +01:00
parent 09412cd7ad
commit 7bc58f3980

View file

@ -435,9 +435,7 @@ class TenantManager
public function event(string $name, &...$args): array
{
return array_reduce($this->eventListeners[$name] ?? [], function ($results, $listener) use ($args) {
$results = array_merge($results, $listener($this, ...$args) ?? []);
return $results;
return array_merge($results, $listener($this, ...$args) ?? []);
}, []);
}