RouteAbstract.php
4 weeks ago
RouteIntegration.php
4 weeks ago
RouteInterface.php
4 weeks ago
UpdateFormFieldsRoute.php
4 weeks ago
UpdateFormSettingsRoute.php
4 weeks ago
RouteInterface.php
43 lines
| 1 | <?php |
| 2 | |
| 3 | namespace WPDesk\FCF\Free\Settings\Route; |
| 4 | |
| 5 | use WPDesk\FCF\Free\Collections\RouteParamBag; |
| 6 | |
| 7 | /** |
| 8 | * Interface for REST API route. |
| 9 | */ |
| 10 | interface RouteInterface { |
| 11 | |
| 12 | /** |
| 13 | * Returns route of REST API endpoint. |
| 14 | * |
| 15 | * @return string Route name. |
| 16 | */ |
| 17 | public function get_endpoint_route(): string; |
| 18 | |
| 19 | /** |
| 20 | * Returns list of HTTP methods for endpoint. |
| 21 | * |
| 22 | * @return string[] List of methods. |
| 23 | */ |
| 24 | public function get_route_methods(): array; |
| 25 | |
| 26 | /** |
| 27 | * Returns list of args for params using to register endpoint. |
| 28 | * |
| 29 | * @return array Args for endpoint params. |
| 30 | */ |
| 31 | public function get_route_params(): array; |
| 32 | |
| 33 | /** |
| 34 | * Returns data to be returned for endpoint. |
| 35 | * |
| 36 | * @param RouteParamBag<string, mixed> $params Params for endpoint. |
| 37 | * |
| 38 | * @return mixed Response data. |
| 39 | * @throws \Exception . |
| 40 | */ |
| 41 | public function get_endpoint_response( RouteParamBag $params ); |
| 42 | } |
| 43 |