<?php
require_once 'UserStateInterface.php';
require_once 'AuthorizedState.php';
class UnauthorizedState implements UserStateInterface
{
private static $_singleton = null;
private function __construct()
{
}
public static function getInstance()
{
if (self::$_singleton == null) {
self::$_singleton = new UnauthorizedState();
}
return self::$_singleton;
}
public function isAuthenticated()
{
return false;
}
public function nextState()
{
return AuthorizedState::getInstance();
}
public function getMenu()
{
$menu = '<a href="?mode=state">ログイン</a>';
return $menu;
}
public function __clone()
{
throw new LogicException('Clone is not allowed against [' . get_class($this) . '].');
}
}