From bbafc9d8e2a6656b13b35a9a0834f5e1eea0640f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Samuel=20=C5=A0tancl?= Date: Fri, 16 Aug 2019 18:20:34 +0200 Subject: [PATCH] is_array check --- src/TenantManager.php | 3 ++- tests/TenantStorageTest.php | 1 + 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/src/TenantManager.php b/src/TenantManager.php index b07c93b1..8da49762 100644 --- a/src/TenantManager.php +++ b/src/TenantManager.php @@ -273,7 +273,8 @@ final class TenantManager { $uuid = $uuid ?: $this->tenant['uuid']; - if (array_key_exists('uuid', $this->tenant) && $uuid === $this->tenant['uuid'] && array_key_exists($key, $this->tenant)) { + if (array_key_exists('uuid', $this->tenant) && $uuid === $this->tenant['uuid'] && + array_key_exists($key, $this->tenant) && ! is_array($key)) { return $this->tenant[$key]; } diff --git a/tests/TenantStorageTest.php b/tests/TenantStorageTest.php index 8904ed18..7999f37c 100644 --- a/tests/TenantStorageTest.php +++ b/tests/TenantStorageTest.php @@ -43,6 +43,7 @@ class TenantStorageTest extends TestCase $data = array_combine($keys, $vals); tenancy()->put($data); + dd(tenant()->get($keys)); $this->assertSame($vals, tenant()->get($keys)); }