1
0

IHandler.php 845 B

123456789101112131415161718192021222324252627282930
  1. <?php
  2. declare(strict_types=1);
  3. /**
  4. * SPDX-FileCopyrightText: 2020 Nextcloud GmbH and Nextcloud contributors
  5. * SPDX-License-Identifier: AGPL-3.0-or-later
  6. */
  7. namespace OCP\Http\WellKnown;
  8. /**
  9. * Interface for an app handler that reacts to requests to Nextcloud's well
  10. * known URLs, e.g. to a WebFinger
  11. *
  12. * @ref https://tools.ietf.org/html/rfc5785
  13. *
  14. * @since 21.0.0
  15. */
  16. interface IHandler {
  17. /**
  18. * @param string $service the name of the well known service, e.g. 'webfinger'
  19. * @param IRequestContext $context
  20. * @param IResponse|null $previousResponse the response of the previous handler, if any
  21. *
  22. * @return IResponse|null a response object if the request could be handled, null otherwise
  23. *
  24. * @since 21.0.0
  25. */
  26. public function handle(string $service, IRequestContext $context, ?IResponse $previousResponse): ?IResponse;
  27. }