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