1 | <?php |
||
8 | class Response extends Message implements ResponseContract, ResponseInterface |
||
9 | { |
||
10 | /** |
||
11 | * @var ResponseInterface |
||
12 | */ |
||
13 | protected $wrapped; |
||
14 | |||
15 | /** |
||
16 | * @param ResponseInterface $wrapper |
||
17 | */ |
||
18 | 25 | public function __construct(ResponseInterface $wrapper) |
|
22 | |||
23 | /** |
||
24 | * Gets the response status code. |
||
25 | * The status code is a 3-digit integer result code of the server's attempt |
||
26 | * to understand and satisfy the request. |
||
27 | * |
||
28 | * @return int Status code. |
||
29 | */ |
||
30 | 10 | public function status() : int |
|
34 | |||
35 | /** |
||
36 | * Gets the body of the message. |
||
37 | * |
||
38 | * @return string Returns the body as string. |
||
39 | */ |
||
40 | 10 | public function body() : string |
|
44 | |||
45 | /** |
||
46 | * @return int|null |
||
47 | */ |
||
48 | 1 | public function size() |
|
52 | |||
53 | /** |
||
54 | * @param string $header |
||
55 | * @param string $value |
||
56 | * |
||
57 | * @return ResponseContract |
||
58 | */ |
||
59 | 1 | public function addHeader(string $header, string $value) : ResponseContract |
|
63 | |||
64 | /** |
||
65 | * @return string |
||
66 | */ |
||
67 | 1 | public function reason() : string |
|
71 | |||
72 | /** |
||
73 | * @return string |
||
74 | */ |
||
75 | 1 | public function protocol() : string |
|
79 | |||
80 | /** |
||
81 | * @return array |
||
82 | */ |
||
83 | 10 | public function headers() : array |
|
87 | |||
88 | /** |
||
89 | * {@inheritdoc} |
||
90 | */ |
||
91 | 1 | public function getStatusCode() |
|
95 | |||
96 | /** |
||
97 | * {@inheritdoc} |
||
98 | */ |
||
99 | 1 | public function withStatus($code, $reasonPhrase = '') |
|
103 | |||
104 | /** |
||
105 | * {@inheritdoc} |
||
106 | */ |
||
107 | 1 | public function getReasonPhrase() |
|
111 | |||
112 | /** |
||
113 | * @return ResponseInterface |
||
114 | */ |
||
115 | 2 | public function toPsr7() : ResponseInterface |
|
119 | |||
120 | /** |
||
121 | * @return ResponseInterface |
||
122 | */ |
||
123 | 1 | protected function getWrapped() |
|
127 | } |
||
128 |