LogoutRoute.php 449 B

12345678910111213141516
  1. <?php
  2. class LogoutRoute implements IRoute {
  3. public static function getInstance() {
  4. return new LogoutRoute(Authorizer::getInstance(), new HeaderWrapper());
  5. }
  6. private $authorizer;
  7. private $header;
  8. private function __construct(Authorizer $authorizer, HeaderWrapper $header) {
  9. $this->authorizer = $authorizer;
  10. $this->header = $header;
  11. }
  12. public function run(Url $url) {
  13. $this->authorizer->logOutUser();
  14. $this->header->location("/");
  15. }
  16. }