user ?: new Guest; } public function setUser($user) { $this->user = $user; } public function isAuthenticated() { return (bool) $this->user; } }