1
0
Fork 0
mirror of https://github.com/archtechx/tenancy.git synced 2026-02-04 19:04:03 +00:00

Rewrite conditional for clarity

This commit is contained in:
Samuel Štancl 2019-08-13 19:11:30 +02:00
parent 0d03414e80
commit 878edfdcee

View file

@ -275,11 +275,12 @@ class TenantManager
*/ */
public function put($key, $value = null, string $uuid = null) public function put($key, $value = null, string $uuid = null)
{ {
if (in_array($key, ['uuid', 'domain'], true) || if (in_array($key, ['uuid', 'domain'], true) || (
(is_array($key) && array_reduce(array_keys($key), function ($result, $k) { is_array($key) && (
return $result || in_array($k, ['uuid', 'domain']); in_array('uuid', array_keys($key), true) ||
}, false)) in_array('domain', array_keys($key), true)
) { )
)) {
throw new CannotChangeUuidOrDomainException; throw new CannotChangeUuidOrDomainException;
} }