Add PhpDoc headers to all components
[GitHub/WoltLab/WCF.git] / wcfsetup / install / files / lib / system / endpoint / IController.class.php
1 <?php
2
3 namespace wcf\system\endpoint;
4
5 use CuyZ\Valinor\Mapper\MappingError;
6 use Psr\Http\Message\ResponseInterface;
7 use Psr\Http\Message\ServerRequestInterface;
8
9 /**
10 * Handles incoming API requests, relying on the `RequestType` attributes to
11 * register the endpoint. The endpoint can contain placeholders for parameters.
12 *
13 * @author Alexander Ebert
14 * @copyright 2001-2024 WoltLab GmbH
15 * @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
16 * @since 6.1
17 */
18 interface IController
19 {
20 /**
21 * Invokes the controller, passing in any placeholders from the endpoint in
22 * the `$variables` array.
23 *
24 * @param array<string, string> $variables
25 * @throws MappingError
26 */
27 public function __invoke(ServerRequestInterface $request, array $variables): ResponseInterface;
28 }