Completed
Push — master ( 4e07a2...96fcad )
by Tobias
03:18
created

MessageFactory   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 22
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 2

Test Coverage

Coverage 0%

Importance

Changes 0
Metric Value
wmc 2
lcom 0
cbo 2
dl 0
loc 22
ccs 0
cts 18
cp 0
rs 10
c 0
b 0
f 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A createRequest() 0 9 1
A createResponse() 0 9 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Nyholm\Psr7\Factory;
6
7
use Nyholm\Psr7\Request;
8
use Nyholm\Psr7\Response;
9
10
/**
11
 * @author Tobias Nyholm <[email protected]>
12
 */
13
class MessageFactory implements \Http\Message\MessageFactory
14
{
15
    public function createRequest(
16
        $method,
17
        $uri,
18
        array $headers = [],
19
        $body = null,
20
        $protocolVersion = '1.1'
21
    ) {
22
        return new Request($method, $uri, $headers, $body, $protocolVersion);
23
    }
24
25
    public function createResponse(
26
        $statusCode = 200,
27
        $reasonPhrase = null,
28
        array $headers = [],
29
        $body = null,
30
        $protocolVersion = '1.1'
31
    ) {
32
        return new Response((int) $statusCode, $headers, $body, $protocolVersion, $reasonPhrase);
33
    }
34
}
35