1
|
|
|
<?php |
2
|
|
|
namespace LunixREST\Endpoint; |
3
|
|
|
|
4
|
|
|
use LunixREST\APIResponse\APIResponseData; |
5
|
|
|
use LunixREST\Endpoint\Exceptions\UnsupportedMethodException; |
6
|
|
|
use LunixREST\APIRequest\APIRequest; |
7
|
|
|
|
8
|
|
|
/** |
9
|
|
|
* An Endpoint that throws UnsupportedMethodException for all requests. |
10
|
|
|
* Class Endpoint |
11
|
|
|
* @package LunixREST\Endpoints |
12
|
|
|
*/ |
13
|
|
|
class DefaultEndpoint implements Endpoint |
14
|
|
|
{ |
15
|
|
|
/** |
16
|
|
|
* @param APIRequest $request |
17
|
|
|
* @return APIResponseData |
18
|
|
|
* @throws UnsupportedMethodException |
19
|
|
|
*/ |
20
|
1 |
|
public function get(APIRequest $request): APIResponseData |
21
|
|
|
{ |
22
|
1 |
|
throw new UnsupportedMethodException('Method not supported'); |
23
|
|
|
} |
24
|
|
|
|
25
|
|
|
/** |
26
|
|
|
* @param APIRequest $request |
27
|
|
|
* @return APIResponseData |
28
|
|
|
* @throws UnsupportedMethodException |
29
|
|
|
*/ |
30
|
1 |
|
public function getAll(APIRequest $request): APIResponseData |
31
|
|
|
{ |
32
|
1 |
|
throw new UnsupportedMethodException('Method not supported'); |
33
|
|
|
} |
34
|
|
|
|
35
|
|
|
/** |
36
|
|
|
* @param APIRequest $request |
37
|
|
|
* @return APIResponseData |
38
|
|
|
* @throws UnsupportedMethodException |
39
|
|
|
*/ |
40
|
1 |
|
public function post(APIRequest $request): APIResponseData |
41
|
|
|
{ |
42
|
1 |
|
throw new UnsupportedMethodException('Method not supported'); |
43
|
|
|
} |
44
|
|
|
|
45
|
|
|
/** |
46
|
|
|
* @param APIRequest $request |
47
|
|
|
* @return APIResponseData |
48
|
|
|
* @throws UnsupportedMethodException |
49
|
|
|
*/ |
50
|
1 |
|
public function postAll(APIRequest $request): APIResponseData |
51
|
|
|
{ |
52
|
1 |
|
throw new UnsupportedMethodException('Method not supported'); |
53
|
|
|
} |
54
|
|
|
|
55
|
|
|
/** |
56
|
|
|
* @param APIRequest $request |
57
|
|
|
* @return APIResponseData |
58
|
|
|
* @throws UnsupportedMethodException |
59
|
|
|
*/ |
60
|
1 |
|
public function put(APIRequest $request): APIResponseData |
61
|
|
|
{ |
62
|
1 |
|
throw new UnsupportedMethodException('Method not supported'); |
63
|
|
|
} |
64
|
|
|
|
65
|
|
|
/** |
66
|
|
|
* @param APIRequest $request |
67
|
|
|
* @return APIResponseData |
68
|
|
|
* @throws UnsupportedMethodException |
69
|
|
|
*/ |
70
|
1 |
|
public function putAll(APIRequest $request): APIResponseData |
71
|
|
|
{ |
72
|
1 |
|
throw new UnsupportedMethodException('Method not supported'); |
73
|
|
|
} |
74
|
|
|
|
75
|
|
|
/** |
76
|
|
|
* @param APIRequest $request |
77
|
|
|
* @return APIResponseData |
78
|
|
|
* @throws UnsupportedMethodException |
79
|
|
|
*/ |
80
|
|
|
public function patch(APIRequest $request): APIResponseData |
81
|
|
|
{ |
82
|
|
|
throw new UnsupportedMethodException('Method not supported'); |
83
|
|
|
} |
84
|
|
|
|
85
|
|
|
/** |
86
|
|
|
* @param APIRequest $request |
87
|
|
|
* @return APIResponseData |
88
|
|
|
* @throws UnsupportedMethodException |
89
|
|
|
*/ |
90
|
|
|
public function patchAll(APIRequest $request): APIResponseData |
91
|
|
|
{ |
92
|
|
|
throw new UnsupportedMethodException('Method not supported'); |
93
|
|
|
} |
94
|
|
|
|
95
|
|
|
/** |
96
|
|
|
* @param APIRequest $request |
97
|
|
|
* @return APIResponseData |
98
|
|
|
* @throws UnsupportedMethodException |
99
|
|
|
*/ |
100
|
1 |
|
public function options(APIRequest $request): APIResponseData |
101
|
|
|
{ |
102
|
1 |
|
throw new UnsupportedMethodException('Method not supported'); |
103
|
|
|
} |
104
|
|
|
|
105
|
|
|
/** |
106
|
|
|
* @param APIRequest $request |
107
|
|
|
* @return APIResponseData |
108
|
|
|
* @throws UnsupportedMethodException |
109
|
|
|
*/ |
110
|
1 |
|
public function optionsAll(APIRequest $request): APIResponseData |
111
|
|
|
{ |
112
|
1 |
|
throw new UnsupportedMethodException('Method not supported'); |
113
|
|
|
} |
114
|
|
|
|
115
|
|
|
/** |
116
|
|
|
* @param APIRequest $request |
117
|
|
|
* @return APIResponseData |
118
|
|
|
* @throws UnsupportedMethodException |
119
|
|
|
*/ |
120
|
1 |
|
public function delete(APIRequest $request): APIResponseData |
121
|
|
|
{ |
122
|
1 |
|
throw new UnsupportedMethodException('Method not supported'); |
123
|
|
|
} |
124
|
|
|
|
125
|
|
|
/** |
126
|
|
|
* @param APIRequest $request |
127
|
|
|
* @return APIResponseData |
128
|
|
|
* @throws UnsupportedMethodException |
129
|
|
|
*/ |
130
|
1 |
|
public function deleteAll(APIRequest $request): APIResponseData |
131
|
|
|
{ |
132
|
1 |
|
throw new UnsupportedMethodException('Method not supported'); |
133
|
|
|
} |
134
|
|
|
} |
135
|
|
|
|