API.php
6 months ago
AbstractListingEndpoint.php
3 weeks ago
ApiException.php
2 months ago
Endpoint.php
3 months ago
EndpointContainer.php
3 years ago
ErrorResponse.php
3 years ago
Exception.php
3 years ago
ListingRequestValidationTrait.php
1 month ago
Request.php
3 years ago
Response.php
1 year ago
index.php
3 years ago
Endpoint.php
23 lines
| 1 | <?php declare(strict_types = 1); |
| 2 | |
| 3 | namespace MailPoet\API\REST; |
| 4 | |
| 5 | if (!defined('ABSPATH')) exit; |
| 6 | |
| 7 | |
| 8 | use MailPoet\Validator\Schema; |
| 9 | use MailPoet\WP\Functions as WPFunctions; |
| 10 | |
| 11 | abstract class Endpoint { |
| 12 | abstract public function handle(Request $request): Response; |
| 13 | |
| 14 | public function checkPermissions(): bool { |
| 15 | return WPFunctions::get()->currentUserCan('admin'); |
| 16 | } |
| 17 | |
| 18 | /** @return array<string, Schema> */ |
| 19 | public static function getRequestSchema(): array { |
| 20 | return []; |
| 21 | } |
| 22 | } |
| 23 |