1 | <?php |
||
16 | abstract class ApiRouteSpec |
||
17 | { |
||
18 | |||
19 | /** |
||
20 | * @var string|null |
||
21 | */ |
||
22 | protected $description; |
||
23 | |||
24 | /** |
||
25 | * @var string |
||
26 | */ |
||
27 | protected $path = '/'; |
||
28 | |||
29 | /** |
||
30 | * @Enum({"CREATE", "READ", "UPDATE", "DELETE", "OPTIONS"}) |
||
31 | * @var string |
||
32 | */ |
||
33 | protected $method; |
||
34 | |||
35 | /** |
||
36 | * @var array |
||
37 | */ |
||
38 | protected $parameters = []; |
||
39 | |||
40 | /** |
||
41 | * @var array |
||
42 | */ |
||
43 | protected $parameters_infos = ['requirement', 'type', 'description', 'default']; |
||
44 | |||
45 | /** |
||
46 | * @var int |
||
47 | */ |
||
48 | protected $priority = 0; |
||
49 | |||
50 | /** |
||
51 | * @Enum({"json", "xml"}) |
||
52 | * @var string |
||
53 | */ |
||
54 | protected $format = 'json'; |
||
55 | |||
56 | /** |
||
57 | * @var array|null |
||
58 | */ |
||
59 | protected $example; |
||
60 | |||
61 | /** |
||
62 | * @var string|null |
||
63 | */ |
||
64 | protected $section; |
||
65 | |||
66 | /** |
||
67 | * @var array |
||
68 | */ |
||
69 | protected $tags = []; |
||
70 | |||
71 | /** |
||
72 | * @var array |
||
73 | */ |
||
74 | protected $response_codes = []; |
||
75 | |||
76 | /** |
||
77 | * @Enum({true, false}) |
||
78 | * @var bool |
||
79 | */ |
||
80 | protected $disable = false; |
||
81 | |||
82 | |||
83 | /** |
||
84 | * @param array $data |
||
85 | */ |
||
86 | public function __construct(array $data) |
||
100 | |||
101 | |||
102 | public function setDescription(?string $description): void |
||
106 | |||
107 | |||
108 | public function getDescription(): ?string |
||
112 | |||
113 | |||
114 | protected function setPath(string $path): void |
||
122 | |||
123 | |||
124 | public function getPath(): string |
||
128 | |||
129 | |||
130 | protected function setMethod(string $method): void |
||
134 | |||
135 | |||
136 | public function getMethod(): string |
||
140 | |||
141 | |||
142 | /** |
||
143 | * @throws ApiRouteWrongPropertyException |
||
144 | */ |
||
145 | protected function setParameters(array $parameters): void |
||
171 | |||
172 | |||
173 | public function getParameters(): array |
||
177 | |||
178 | |||
179 | public function setPriority(int $priority): void |
||
183 | |||
184 | |||
185 | public function getPriority(): int |
||
189 | |||
190 | |||
191 | public function setFormat(string $format): void |
||
195 | |||
196 | |||
197 | public function getFormat(): string |
||
201 | |||
202 | |||
203 | public function setExample(?array $example): void |
||
207 | |||
208 | |||
209 | public function getExample(): ?array |
||
213 | |||
214 | |||
215 | public function setSection(?string $section): void |
||
219 | |||
220 | |||
221 | public function getSection(): ?string |
||
225 | |||
226 | |||
227 | public function setTags(array $tags): void |
||
231 | |||
232 | |||
233 | public function getTags(): array |
||
250 | |||
251 | |||
252 | public function setResponseCodes(array $response_codes): void |
||
256 | |||
257 | |||
258 | public function getResponseCodes(): array |
||
262 | |||
263 | |||
264 | public function setDisable(bool $disable): void |
||
268 | |||
269 | |||
270 | public function getDisable(): bool |
||
274 | } |
||
275 |