Passed
Push — master ( b65012...5ddc87 )
by Zlatin
01:29
created

ResponseFactory   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 12
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
dl 0
loc 12
ccs 3
cts 3
cp 1
rs 10
c 0
b 0
f 0
wmc 1

1 Method

Rating   Name   Duplication   Size   Complexity  
A createResponse() 0 5 1
1
<?php
2
namespace DevOp\Core\Http;
3
4
use DevOp\Core\Http\Response;
5
use DevOp\Core\Http\StreamFactory;
6
use Interop\Http\Factory\ResponseFactoryInterface;
7
8
class ResponseFactory implements ResponseFactoryInterface
9
{
10
11
    /**
12
     * @param int $code
13
     * @return Response
14
     */
15 12
    public function createResponse($code = 200)
16
    {
17 12
        $body = (new StreamFactory())->createStreamFromFile('php://temp', "wb+");
18
19 12
        return new Response($body, $code);
20
    }
21
}
22