From 878edfdceecf894c30b4318b1ebcbaab940a22f8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Samuel=20=C5=A0tancl?= Date: Tue, 13 Aug 2019 19:11:30 +0200 Subject: [PATCH] Rewrite conditional for clarity --- src/TenantManager.php | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/src/TenantManager.php b/src/TenantManager.php index 18ccc9f1..006bcce2 100644 --- a/src/TenantManager.php +++ b/src/TenantManager.php @@ -275,11 +275,12 @@ class TenantManager */ public function put($key, $value = null, string $uuid = null) { - if (in_array($key, ['uuid', 'domain'], true) || - (is_array($key) && array_reduce(array_keys($key), function ($result, $k) { - return $result || in_array($k, ['uuid', 'domain']); - }, false)) - ) { + if (in_array($key, ['uuid', 'domain'], true) || ( + is_array($key) && ( + in_array('uuid', array_keys($key), true) || + in_array('domain', array_keys($key), true) + ) + )) { throw new CannotChangeUuidOrDomainException; }