Upgrade to 4.6.0

This commit is contained in:
Bastian Allgeier
2025-01-30 12:15:44 +01:00
parent d71db84033
commit daf499e2e4
179 changed files with 1848 additions and 688 deletions

View File

@@ -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');
}