Response   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 23
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 1
eloc 3
c 1
b 0
f 0
dl 0
loc 23
ccs 2
cts 2
cp 1
rs 10

1 Method

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 8 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace HttpSoft\Message;
6
7
use Psr\Http\Message\ResponseInterface;
8
use Psr\Http\Message\StreamInterface;
9
10
final class Response implements ResponseInterface
11
{
12
    use ResponseTrait;
13
14
    /**
15
     * @param int $statusCode The HTTP status code.
16
     * @param array $headers The headers to send with the response.
17
     * @param StreamInterface|string|resource|null $body The body of the response. Must be one of the following:
18
     *  - an instance of `StreamInterface`;
19
     *  - a string stream identifier (e.g., 'php://temp') or a file path;
20
     *  - a valid stream resource;
21
     *  - `null`.
22
     * @param string $protocol The HTTP protocol version.
23
     * @param string $reasonPhrase The reason phrase associated with the status code.
24
     */
25 74
    public function __construct(
26
        int $statusCode = 200,
27
        array $headers = [],
28
        $body = null,
29
        string $protocol = '1.1',
30
        string $reasonPhrase = ''
31
    ) {
32 74
        $this->init($statusCode, $reasonPhrase, $headers, $body, $protocol);
33
    }
34
}
35