From 363b2fc56e0d373976d045d92c61a3800b8c456a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Samuel=20=C5=A0tancl?= Date: Sat, 7 Sep 2019 16:47:40 +0200 Subject: [PATCH] Refactor eventCallback() --- src/TenantManagerv2.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/TenantManagerv2.php b/src/TenantManagerv2.php index ce2efa8d..11a6cdfa 100644 --- a/src/TenantManagerv2.php +++ b/src/TenantManagerv2.php @@ -103,7 +103,7 @@ class TenantManagerv2 } /** - * Add event callback. + * Add an event callback. * * @param string $name * @param callable $callback @@ -111,7 +111,7 @@ class TenantManagerv2 */ public function eventCallback(string $name, callable $callback): self { - isset($this->eventCallbacks[$name]) || $this->eventCallbacks[$name] = []; + $this->eventCallbacks[$name] = $this->eventCallbacks[$name] ?? []; $this->eventCallbacks[$name][] = $callback; return $this;