4 * This file is part of the Symfony package.
6 * (c) Fabien Potencier <fabien@symfony.com>
8 * For the full copyright and license information, please view the LICENSE
9 * file that was distributed with this source code.
12 namespace Symfony\Component\HttpKernel;
14 use Symfony\Component\HttpFoundation\Request;
15 use Symfony\Component\HttpFoundation\Response;
18 * HttpKernelInterface handles a Request to convert it to a Response.
20 * @author Fabien Potencier <fabien@symfony.com>
22 interface HttpKernelInterface
24 const MASTER_REQUEST = 1;
25 const SUB_REQUEST = 2;
28 * Handles a Request to convert it to a Response.
30 * When $catch is true, the implementation must catch all exceptions
31 * and do its best to convert them to a Response instance.
33 * @param Request $request A Request instance
34 * @param int $type The type of the request
35 * (one of HttpKernelInterface::MASTER_REQUEST or HttpKernelInterface::SUB_REQUEST)
36 * @param bool $catch Whether to catch exceptions or not
38 * @return Response A Response instance
40 * @throws \Exception When an Exception occurs during processing
42 public function handle(Request $request, $type = self::MASTER_REQUEST, $catch = true);