geno/wp-content/plugins/mailpoet/lib/API/JSON/SuccessResponse.php
2024-02-01 11:54:18 +00:00

27 lines
519 B
PHP

<?php // phpcs:ignore SlevomatCodingStandard.TypeHints.DeclareStrictTypes.DeclareStrictTypesMissing
namespace MailPoet\API\JSON;
if (!defined('ABSPATH')) exit;
class SuccessResponse extends Response {
public $data;
public function __construct(
$data = [],
$meta = [],
$status = self::STATUS_OK
) {
parent::__construct($status, $meta);
$this->data = $data;
}
public function getData() {
if ($this->data === null) return [];
return [
'data' => $this->data,
];
}
}