Auth.php 860 B

123456789101112131415161718192021222324252627282930313233343536
  1. <?php
  2. /**
  3. * Authentication provider interface
  4. *
  5. * @package Requests\Authentication
  6. */
  7. namespace WpOrg\Requests;
  8. use WpOrg\Requests\Hooks;
  9. /**
  10. * Authentication provider interface
  11. *
  12. * Implement this interface to act as an authentication provider.
  13. *
  14. * Parameters should be passed via the constructor where possible, as this
  15. * makes it much easier for users to use your provider.
  16. *
  17. * @see \WpOrg\Requests\Hooks
  18. *
  19. * @package Requests\Authentication
  20. */
  21. interface Auth {
  22. /**
  23. * Register hooks as needed
  24. *
  25. * This method is called in {@see \WpOrg\Requests\Requests::request()} when the user
  26. * has set an instance as the 'auth' option. Use this callback to register all the
  27. * hooks you'll need.
  28. *
  29. * @see \WpOrg\Requests\Hooks::register()
  30. * @param \WpOrg\Requests\Hooks $hooks Hook system
  31. */
  32. public function register(Hooks $hooks);
  33. }