12345678910111213141516 |
- <?php
- class LogoutRoute implements IRoute {
- public static function getInstance() {
- return new LogoutRoute(Authorizer::getInstance(), new HeaderWrapper());
- }
- private $authorizer;
- private $header;
- private function __construct(Authorizer $authorizer, HeaderWrapper $header) {
- $this->authorizer = $authorizer;
- $this->header = $header;
- }
- public function run(Url $url) {
- $this->authorizer->logOutUser();
- $this->header->location("/");
- }
- }
|