[CLEANUP] Alwas put null at the last position
[Packages/TYPO3.CMS.git] / typo3 / sysext / core / Classes / Http / RequestHandlerInterface.php
1 <?php
2 namespace TYPO3\CMS\Core\Http;
3
4 /*
5 * This file is part of the TYPO3 CMS project.
6 *
7 * It is free software; you can redistribute it and/or modify it under
8 * the terms of the GNU General Public License, either version 2
9 * of the License, or any later version.
10 *
11 * For the full copyright and license information, please read the
12 * LICENSE.txt file that was distributed with this source code.
13 *
14 * The TYPO3 project - inspiring people to share!
15 */
16
17 /**
18 * The interface for a request handler
19 * see RequestHandler in EXT:backend/Classes/Http/ and EXT:frontend/Classes/Http
20 *
21 * @api
22 */
23 interface RequestHandlerInterface
24 {
25 /**
26 * Handles a raw request
27 *
28 * @param \Psr\Http\Message\ServerRequestInterface $request
29 * @return \Psr\Http\Message\ResponseInterface|null
30 * @api
31 */
32 public function handleRequest(\Psr\Http\Message\ServerRequestInterface $request);
33
34 /**
35 * Checks if the request handler can handle the given request.
36 *
37 * @param \Psr\Http\Message\ServerRequestInterface $request
38 * @return bool TRUE if it can handle the request, otherwise FALSE
39 * @api
40 */
41 public function canHandleRequest(\Psr\Http\Message\ServerRequestInterface $request);
42
43 /**
44 * Returns the priority - how eager the handler is to actually handle the
45 * request. An integer > 0 means "I want to handle this request" where
46 * "100" is default. "0" means "I am a fallback solution".
47 *
48 * @return int The priority of the request handler
49 * @api
50 */
51 public function getPriority();
52 }