[TASK] Ensure HTTP RequestHandlers always return a PSR-7 Repsonse
[Packages/TYPO3.CMS.git] / typo3 / sysext / core / Classes / Console / RequestHandlerInterface.php
1 <?php
2 declare(strict_types = 1);
3 namespace TYPO3\CMS\Core\Console;
4
5 /*
6 * This file is part of the TYPO3 CMS project.
7 *
8 * It is free software; you can redistribute it and/or modify it under
9 * the terms of the GNU General Public License, either version 2
10 * of the License, or any later version.
11 *
12 * For the full copyright and license information, please read the
13 * LICENSE.txt file that was distributed with this source code.
14 *
15 * The TYPO3 project - inspiring people to share!
16 */
17 use Symfony\Component\Console\Input\InputInterface;
18 use Symfony\Component\Console\Output\OutputInterface;
19
20 /**
21 * The interface for a request handler for a console-based application
22 *
23 * @api
24 */
25 interface RequestHandlerInterface
26 {
27 /**
28 * Handles a CLI request
29 *
30 * @param InputInterface $input
31 * @return OutputInterface|null
32 * @api
33 */
34 public function handleRequest(InputInterface $input);
35
36 /**
37 * Checks if the request handler can handle the given request.
38 *
39 * @param InputInterface $input
40 * @return bool TRUE if it can handle the request, otherwise FALSE
41 * @api
42 */
43 public function canHandleRequest(InputInterface $input);
44
45 /**
46 * Returns the priority - how eager the handler is to actually handle the
47 * request. An integer > 0 means "I want to handle this request" where
48 * "100" is default. "0" means "I am a fallback solution".
49 *
50 * @return int The priority of the request handler
51 * @api
52 */
53 public function getPriority();
54 }