Conditions | 3 |
Paths | 3 |
Total Lines | 15 |
Code Lines | 10 |
Lines | 0 |
Ratio | 0 % |
Tests | 9 |
CRAP Score | 3.054 |
Changes | 0 |
1 | <?php |
||
22 | 12 | public function __construct($method, UriInterface $uri, array $headers = [], $body = 'php://temp', $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 | 11 | } else if (is_resource($body)) { |
|
30 | $this->body = (new Factory\StreamFactory())->createStreamFromResource($body); |
||
31 | } else { |
||
32 | 10 | $this->body = (new Factory\StreamFactory())->createStreamFromFile($body, "r+"); |
|
33 | } |
||
34 | |||
35 | 12 | $this->headers = $headers; |
|
36 | 12 | $this->protocolVersion = $protocolVersion; |
|
37 | 12 | } |
|
39 |