]> git.mxchange.org Git - friendica.git/blob - src/Capabilities/IRespondToRequests.php
Introduce `Response` for Modules to create a testable way for module responses
[friendica.git] / src / Capabilities / IRespondToRequests.php
1 <?php
2
3 namespace Friendica\Capabilities;
4
5 interface IRespondToRequests
6 {
7         const TYPE_CONTENT     = 'content';
8         const TYPE_RAW_CONTENT = 'rawContent';
9         const TYPE_POST        = 'post';
10         const TYPE_PUT         = 'put';
11         const TYPE_DELETE      = 'delete';
12         const TYPE_PATCH       = 'patch';
13
14         const ALLOWED_TYPES = [
15                 self::TYPE_CONTENT,
16                 self::TYPE_RAW_CONTENT,
17                 self::TYPE_POST,
18                 self::TYPE_PUT,
19                 self::TYPE_DELETE,
20                 self::TYPE_PATCH,
21         ];
22
23         /**
24          * Returns all set headers during the module execution
25          *
26          * @return string[][]
27          */
28         public function getHeaders(): array;
29
30         /**
31          * Returns the output of the module
32          *
33          * @return string
34          */
35         public function getContent(): string;
36
37         /**
38          * Returns the response type of the current request
39          *
40          * @return string
41          */
42         public function getTyp(): string;
43 }