You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

48 lines
1.5 KiB

3 years ago
  1. <?php
  2. /*
  3. * This file is part of the Symfony package.
  4. *
  5. * (c) Fabien Potencier <fabien@symfony.com>
  6. *
  7. * For the full copyright and license information, please view the LICENSE
  8. * file that was distributed with this source code.
  9. */
  10. namespace Symfony\Component\HttpKernel;
  11. use Symfony\Component\HttpFoundation\Request;
  12. use Symfony\Component\HttpFoundation\Response;
  13. /**
  14. * HttpKernelInterface handles a Request to convert it to a Response.
  15. *
  16. * @author Fabien Potencier <fabien@symfony.com>
  17. */
  18. interface HttpKernelInterface
  19. {
  20. public const MAIN_REQUEST = 1;
  21. public const SUB_REQUEST = 2;
  22. /**
  23. * @deprecated since symfony/http-kernel 5.3, use MAIN_REQUEST instead.
  24. * To ease the migration, this constant won't be removed until Symfony 7.0.
  25. */
  26. public const MASTER_REQUEST = self::MAIN_REQUEST;
  27. /**
  28. * Handles a Request to convert it to a Response.
  29. *
  30. * When $catch is true, the implementation must catch all exceptions
  31. * and do its best to convert them to a Response instance.
  32. *
  33. * @param int $type The type of the request
  34. * (one of HttpKernelInterface::MAIN_REQUEST or HttpKernelInterface::SUB_REQUEST)
  35. * @param bool $catch Whether to catch exceptions or not
  36. *
  37. * @return Response A Response instance
  38. *
  39. * @throws \Exception When an Exception occurs during processing
  40. */
  41. public function handle(Request $request, int $type = self::MAIN_REQUEST, bool $catch = true);
  42. }