EmptyResponse::__construct()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 7
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 1
c 1
b 0
f 0
nc 1
nop 4
dl 0
loc 7
ccs 2
cts 2
cp 1
crap 1
rs 10
1
<?php
2
3
declare(strict_types=1);
4
5
namespace HttpSoft\Response;
6
7
use HttpSoft\Message\Stream;
8
use Psr\Http\Message\ResponseInterface;
9
10
final class EmptyResponse implements ResponseInterface, ResponseStatusCodeInterface
11
{
12
    use ResponseExtensionTrait;
13
14
    /**
15
     * @param int $code
16
     * @param array $headers
17
     * @param string $protocol
18
     * @param string $reasonPhrase
19
     */
20 25
    public function __construct(
21
        int $code = self::STATUS_NO_CONTENT,
22
        array $headers = [],
23
        string $protocol = '1.1',
24
        string $reasonPhrase = ''
25
    ) {
26 25
        $this->init($code, $reasonPhrase, $headers, new Stream('php://temp', 'r'), $protocol);
27
    }
28
}
29