Upgrade to 4.6.0
This commit is contained in:
@@ -49,19 +49,19 @@ class Users extends Collection
|
||||
if ($object instanceof self) {
|
||||
$this->data = array_merge($this->data, $object->data);
|
||||
|
||||
// add a user by id
|
||||
// add a user by id
|
||||
} elseif (
|
||||
is_string($object) === true &&
|
||||
$user = App::instance()->user($object)
|
||||
) {
|
||||
$this->__set($user->id(), $user);
|
||||
|
||||
// add a user object
|
||||
// add a user object
|
||||
} elseif ($object instanceof User) {
|
||||
$this->__set($object->id(), $object);
|
||||
|
||||
// give a useful error message on invalid input;
|
||||
// silently ignore "empty" values for compatibility with existing setups
|
||||
// give a useful error message on invalid input;
|
||||
// silently ignore "empty" values for compatibility with existing setups
|
||||
} elseif (in_array($object, [null, false, true], true) !== true) {
|
||||
throw new InvalidArgumentException('You must pass a Users or User object or an ID of an existing user to the Users collection');
|
||||
}
|
||||
|
Reference in New Issue
Block a user