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:
parent
0d03414e80
commit
878edfdcee
1 changed files with 6 additions and 5 deletions
|
|
@ -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;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue