2017-03-19 02:30:36 +00:00
|
|
|
<?php
|
|
|
|
declare(strict_types=1);
|
2017-03-28 04:12:12 +00:00
|
|
|
namespace JKingWeb\Arsse\REST;
|
2017-03-19 02:30:36 +00:00
|
|
|
|
|
|
|
class Response {
|
2017-04-07 01:41:21 +00:00
|
|
|
const T_JSON = "application/json";
|
|
|
|
const T_XML = "application/xml";
|
|
|
|
const T_TEXT = "text/plain";
|
2017-03-20 01:50:00 +00:00
|
|
|
|
2017-04-07 01:41:21 +00:00
|
|
|
public $code;
|
|
|
|
public $payload;
|
|
|
|
public $type;
|
|
|
|
public $fields;
|
2017-03-20 01:50:00 +00:00
|
|
|
|
2017-04-07 01:41:21 +00:00
|
|
|
|
|
|
|
function __construct(int $code, $payload = null, string $type = self::T_JSON, array $extraFields = []) {
|
|
|
|
$this->code = $code;
|
|
|
|
$this->payload = $payload;
|
|
|
|
$this->type = $type;
|
|
|
|
$this->fields = $extraFields;
|
|
|
|
}
|
2017-03-19 02:30:36 +00:00
|
|
|
}
|