Fix Users manager

This commit is contained in:
Visman 2021-12-04 21:07:25 +07:00
parent 1d8ecda60b
commit 62e963b97c

View file

@ -138,13 +138,13 @@ class Users extends Manager
*/
public function guest(array $attrs = []): User
{
$cache = $this->c->Cache->get(CACHE_NAME);
$cache = $this->c->Cache->get(self::CACHE_NAME);
if (! \is_array($cache)) {
$cache = $this->c->groups->get(FORK_GROUP_GUEST)->getAttrs();
if (true !== $this->c->Cache->set(CACHE_NAME, $cache)) {
throw new RuntimeException('Unable to write value to cache - ' . CACHE_NAME);
if (true !== $this->c->Cache->set(self::CACHE_NAME, $cache)) {
throw new RuntimeException('Unable to write value to cache - ' . self::CACHE_NAME);
}
}
@ -163,8 +163,8 @@ class Users extends Manager
*/
public function resetGuest(): Users
{
if (true !== $this->c->Cache->delete(CACHE_NAME)) {
throw new RuntimeException('Unable to remove key from cache - ' . CACHE_NAME);
if (true !== $this->c->Cache->delete(self::CACHE_NAME)) {
throw new RuntimeException('Unable to remove key from cache - ' . self::CACHE_NAME);
}
return $this;