1 | <?php |
||
7 | class Response extends PsrResponse |
||
8 | { |
||
9 | /** |
||
10 | * @var string |
||
11 | */ |
||
12 | protected $contentType = 'text/html'; |
||
13 | |||
14 | /** |
||
15 | * @var boolean |
||
16 | */ |
||
17 | protected $cache = false; |
||
18 | |||
19 | /** |
||
20 | * @var boolean |
||
21 | */ |
||
22 | protected $compression = true; |
||
23 | |||
24 | /** |
||
25 | * @param $body |
||
26 | * @param $code |
||
27 | * @return Response |
||
28 | */ |
||
29 | 12 | public static function create($body = '', $code = 200) |
|
37 | |||
38 | /** |
||
39 | * Set response caching, blank for default |
||
40 | * |
||
41 | * @param boolean $value |
||
42 | * @return bool |
||
43 | */ |
||
44 | 1 | public function setCache($value = false) |
|
48 | |||
49 | /** |
||
50 | * Set output compression, blank for default |
||
51 | * |
||
52 | * @param boolean $value |
||
53 | * @return bool |
||
54 | */ |
||
55 | 1 | public function setCompression($value = true) |
|
59 | |||
60 | /** |
||
61 | * Modify the response |
||
62 | * |
||
63 | * @param \Closure $closure |
||
64 | */ |
||
65 | 1 | public function modify(\Closure $closure) |
|
69 | |||
70 | /** |
||
71 | * Sends the response |
||
72 | * We ignore coverage here because |
||
73 | * headers cannot be tested in cli sapi |
||
74 | * |
||
75 | * @codeCoverageIgnore |
||
76 | */ |
||
77 | public function send() |
||
99 | |||
100 | /** |
||
101 | * @return string |
||
102 | */ |
||
103 | 1 | public function __toString() |
|
107 | } |
||
108 |