AuthGuard.php 672 B

12345678910111213141516171819202122232425262728293031
  1. <?php
  2. declare(strict_types=1);
  3. /**
  4. * This file is part of qbhy/hyperf-auth.
  5. *
  6. * @link https://github.com/qbhy/hyperf-auth
  7. * @document https://github.com/qbhy/hyperf-auth/blob/master/README.md
  8. * @contact qbhy0715@qq.com
  9. * @license https://github.com/qbhy/hyperf-auth/blob/master/LICENSE
  10. */
  11. namespace Qbhy\HyperfAuth;
  12. interface AuthGuard
  13. {
  14. public function id();
  15. public function login(Authenticatable $user);
  16. public function user(): ?Authenticatable;
  17. public function check(): bool;
  18. public function guest(): bool;
  19. public function logout();
  20. public function getProvider(): UserProvider;
  21. public function getName(): string;
  22. }