Conditions | 4 |
Paths | 4 |
Total Lines | 15 |
Code Lines | 10 |
Lines | 0 |
Ratio | 0 % |
Tests | 9 |
CRAP Score | 4.0961 |
Changes | 0 |
1 | <?php |
||
22 | 12 | public function __construct($method, UriInterface $uri, array $headers = [], StreamInterface $body = null, $protocolVersion = '1.1') |
|
23 | { |
||
24 | 12 | $this->method = $method; |
|
25 | 12 | $this->uri = new Uri($uri); |
|
26 | |||
27 | 12 | if ($body instanceof StreamInterface) { |
|
28 | 2 | $this->body = $body; |
|
29 | 10 | } else if (is_resource($body)) { |
|
|
|||
30 | $this->body = (new Factory\StreamFactory())->createStreamFromFile($body, "r+"); |
||
31 | 10 | } else if (is_string($body)) { |
|
32 | $this->body = (new Factory\StreamFactory())->createStream($body); |
||
33 | } |
||
34 | |||
35 | 12 | $this->headers = $headers; |
|
36 | 12 | $this->protocolVersion = $protocolVersion; |
|
37 | 12 | } |
|
39 |