-
-
Notifications
You must be signed in to change notification settings - Fork 166
Expand file tree
/
Copy pathResponse.php
More file actions
36 lines (32 loc) · 871 Bytes
/
Response.php
File metadata and controls
36 lines (32 loc) · 871 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
<?php
namespace React\Http;
use RingCentral\Psr7\Response as Psr7Response;
use React\Stream\ReadableStreamInterface;
use React\Http\HttpBodyStream;
/**
* Implementation of the PSR-7 ResponseInterface
* This class is an extension of RingCentral\Psr7\Response.
* The only difference is that this class will accept implemenations
* of the ReactPHPs ReadableStreamInterface for $body.
*/
class Response extends Psr7Response
{
public function __construct(
$status = 200,
array $headers = array(),
$body = null,
$version = '1.1',
$reason = null
) {
if ($body instanceof ReadableStreamInterface) {
$body = new HttpBodyStream($body, null);
}
parent::__construct(
$status,
$headers,
$body,
$version,
$reason
);
}
}