]> git.mxchange.org Git - friendica.git/blob - src/Capabilities/ICanHandleRequests.php
0e1582bf64080e582fffaae52311a5492c05b5ce
[friendica.git] / src / Capabilities / ICanHandleRequests.php
1 <?php
2
3 namespace Friendica\Capabilities;
4
5 /**
6  * This interface provides the capability to handle requests from clients and returns the desired outcome
7  */
8 interface ICanHandleRequests
9 {
10         /**
11          * Initialization method common to both content() and post()
12          *
13          * Extend this method if you need to do any shared processing before both
14          * content() or post()
15          */
16         public static function init(array $parameters = []);
17
18         /**
19          * Module GET method to display raw content from technical endpoints
20          *
21          * Extend this method if the module is supposed to return communication data,
22          * e.g. from protocol implementations.
23          */
24         public static function rawContent(array $parameters = []);
25
26         /**
27          * Module GET method to display any content
28          *
29          * Extend this method if the module is supposed to return any display
30          * through a GET request. It can be an HTML page through templating or a
31          * XML feed or a JSON output.
32          *
33          * @return string
34          */
35         public static function content(array $parameters = []);
36
37         /**
38          * Module DELETE method to process submitted data
39          *
40          * Extend this method if the module is supposed to process DELETE requests.
41          * Doesn't display any content
42          */
43         public static function delete(array $parameters = []);
44
45         /**
46          * Module PATCH method to process submitted data
47          *
48          * Extend this method if the module is supposed to process PATCH requests.
49          * Doesn't display any content
50          */
51         public static function patch(array $parameters = []);
52
53         /**
54          * Module POST method to process submitted data
55          *
56          * Extend this method if the module is supposed to process POST requests.
57          * Doesn't display any content
58          */
59         public static function post(array $parameters = []);
60
61         /**
62          * Called after post()
63          *
64          * Unknown purpose
65          */
66         public static function afterpost(array $parameters = []);
67
68         /**
69          * Module PUT method to process submitted data
70          *
71          * Extend this method if the module is supposed to process PUT requests.
72          * Doesn't display any content
73          */
74         public static function put(array $parameters = []);
75
76         public static function getClassName(): string;
77
78         public static function getParameters(): array;
79 }