sessionHelper = $sessionHelper; $this->adminUserRepository = $adminUserRepository; } public function isLoggedIn(): bool { return $this->sessionHelper->getUserId() !== null; } public function getCurrentUser(): AdminUser { $userId = $this->sessionHelper->getUserId(); if (empty($userId)) { throw new RuntimeException('Not logged in!'); } return $this->adminUserRepository->getUserById($userId); } }