| Total Complexity | 5 |
| Total Lines | 30 |
| Duplicated Lines | 0 % |
| Coverage | 100% |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 18 | class HttplugFactory implements MessageFactory, StreamFactory, UriFactory |
||
| 19 | 1 | { |
|
| 20 | 1 | public function createRequest($method, $uri, array $headers = [], $body = null, $protocolVersion = '1.1'): RequestInterface |
|
| 21 | { |
||
| 22 | $uri = $this->createUri($uri); |
||
| 23 | 1 | return new Request($method, $uri, $headers, $body, $protocolVersion); |
|
| 24 | } |
||
| 25 | |||
| 26 | public function createResponse( |
||
| 27 | $statusCode = 200, |
||
| 28 | $reasonPhrase = null, |
||
| 29 | array $headers = [], |
||
| 30 | 1 | $body = null, |
|
| 31 | $version = '1.1' |
||
| 32 | ): ResponseInterface { |
||
| 33 | 1 | return new Response((int)$statusCode, $headers, $body, $version, $reasonPhrase); |
|
| 34 | } |
||
| 35 | 1 | ||
| 36 | public function createStream($body = null): StreamInterface |
||
| 39 | } |
||
| 40 | 2 | ||
| 41 | 1 | public function createUri($uri = ''): UriInterface |
|
| 48 | } |
||
| 49 | } |