From 7bc58f39807875a2d249dc94983ea82e20b5abe0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Samuel=20=C5=A0tancl?= Date: Mon, 28 Oct 2019 21:00:34 +0100 Subject: [PATCH] Simplify reduce --- src/TenantManager.php | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/TenantManager.php b/src/TenantManager.php index 97226b62..b22bc88f 100644 --- a/src/TenantManager.php +++ b/src/TenantManager.php @@ -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) ?? []); }, []); }