Avoid type warning when using array_combine on empty arrays
This commit is contained in:
parent
f1903855b9
commit
8eb7db9b35
|
@ -198,7 +198,9 @@ class User
|
||||||
public function setPermissions(array $permissions)
|
public function setPermissions(array $permissions)
|
||||||
{
|
{
|
||||||
natcasesort($permissions);
|
natcasesort($permissions);
|
||||||
$this->permissions = array_combine($permissions, $permissions);
|
if (! empty($permissions)) {
|
||||||
|
$this->permissions = array_combine($permissions, $permissions);
|
||||||
|
}
|
||||||
return $this;
|
return $this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue