Use short array syntax
[MAILPOET-2090]
This commit is contained in:
@@ -8,33 +8,33 @@ use MailPoet\WP\Functions as WPFunctions;
|
||||
if (!defined('ABSPATH')) exit;
|
||||
|
||||
abstract class Endpoint {
|
||||
public $permissions = array(
|
||||
public $permissions = [
|
||||
'global' => AccessControl::PERMISSION_MANAGE_SETTINGS,
|
||||
'methods' => array()
|
||||
);
|
||||
'methods' => [],
|
||||
];
|
||||
|
||||
function successResponse(
|
||||
$data = array(), $meta = array(), $status = Response::STATUS_OK
|
||||
$data = [], $meta = [], $status = Response::STATUS_OK
|
||||
) {
|
||||
return new SuccessResponse($data, $meta, $status);
|
||||
}
|
||||
|
||||
function errorResponse(
|
||||
$errors = array(), $meta = array(), $status = Response::STATUS_NOT_FOUND
|
||||
$errors = [], $meta = [], $status = Response::STATUS_NOT_FOUND
|
||||
) {
|
||||
if (empty($errors)) {
|
||||
$errors = array(
|
||||
Error::UNKNOWN => WPFunctions::get()->__('An unknown error occurred.', 'mailpoet')
|
||||
);
|
||||
$errors = [
|
||||
Error::UNKNOWN => WPFunctions::get()->__('An unknown error occurred.', 'mailpoet'),
|
||||
];
|
||||
}
|
||||
return new ErrorResponse($errors, $meta, $status);
|
||||
}
|
||||
|
||||
function badRequest($errors = array(), $meta = array()) {
|
||||
function badRequest($errors = [], $meta = []) {
|
||||
if (empty($errors)) {
|
||||
$errors = array(
|
||||
Error::BAD_REQUEST => WPFunctions::get()->__('Invalid request parameters', 'mailpoet')
|
||||
);
|
||||
$errors = [
|
||||
Error::BAD_REQUEST => WPFunctions::get()->__('Invalid request parameters', 'mailpoet'),
|
||||
];
|
||||
}
|
||||
return new ErrorResponse($errors, $meta, Response::STATUS_BAD_REQUEST);
|
||||
}
|
||||
|
Reference in New Issue
Block a user