1 | <?php |
||
10 | final class ControllerResponse |
||
11 | { |
||
12 | private $returnType; |
||
13 | private $headers; |
||
14 | private $data; |
||
15 | private $statusCode; |
||
16 | private $metaData; |
||
17 | |||
18 | |||
19 | |||
20 | public function __construct(int $returnType, int $statusCode, array $headers, array $data, array $metaData) |
||
28 | |||
29 | public static function CUSTOM(int $statusCode, array $data, array $metaData, array $headers) : self |
||
37 | |||
38 | public static function HTML(int $statusCode, array $data, ?array $metaData = []) : self |
||
42 | |||
43 | public static function JSON(int $statusCode, array $data, ?array $metaData = []) : self |
||
47 | |||
48 | public static function TEXT(int $statusCode, array $data, ?array $metaData = []) : self |
||
52 | |||
53 | public static function XML(int $statusCode, array $xmlData, ?array $metaData = []) : self |
||
57 | |||
58 | public static function REDIRECT(int $statusCode, string $redirectUrl) : self |
||
62 | |||
63 | public static function DOWNLOAD(int $statusCode, string $filePath, ?string $fileName = null) : self |
||
79 | |||
80 | public function getReturnType() : int |
||
84 | |||
85 | public function getStatusCode() : int |
||
89 | |||
90 | public function getHeaders() : array |
||
94 | |||
95 | public function getData() : array |
||
99 | |||
100 | public function getMetaData() : array |
||
104 | } |
||
105 |