1
0
Fork 0
mirror of https://github.com/archtechx/tenancy.git synced 2025-12-13 18:24:04 +00:00

is_array check

This commit is contained in:
Samuel Štancl 2019-08-16 18:20:34 +02:00
parent 3c9ead6aac
commit bbafc9d8e2
2 changed files with 3 additions and 1 deletions

View file

@ -273,7 +273,8 @@ final class TenantManager
{ {
$uuid = $uuid ?: $this->tenant['uuid']; $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]; return $this->tenant[$key];
} }

View file

@ -43,6 +43,7 @@ class TenantStorageTest extends TestCase
$data = array_combine($keys, $vals); $data = array_combine($keys, $vals);
tenancy()->put($data); tenancy()->put($data);
dd(tenant()->get($keys));
$this->assertSame($vals, tenant()->get($keys)); $this->assertSame($vals, tenant()->get($keys));
} }