DefaultOutputWriter::setResponseCode()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 3

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 0
Metric Value
cc 1
nc 1
nop 1
dl 0
loc 3
ccs 0
cts 0
cp 0
crap 2
rs 10
c 0
b 0
f 0
1
<?php declare(strict_types=1);
2
3
namespace DaveRandom\Resume;
4
5
final class DefaultOutputWriter implements OutputWriter
6
{
7
    /**
8
     * {@inheritdoc}
9
     * @codeCoverageIgnore
10
     */
11
    public function setResponseCode(int $code)
12
    {
13
        \header("HTTP/1.1 {$code} " . self::RESPONSE_MESSAGES[$code]);
14
    }
15
16
    /**
17
     * {@inheritdoc}
18
     * @codeCoverageIgnore
19
     */
20
    public function sendHeader(string $name, string $value)
21
    {
22
        \header("{$name}: {$value}");
23
    }
24
25
    /**
26
     * {@inheritdoc}
27
     */
28 1
    public function sendData(string $data)
29
    {
30 1
        echo $data;
31
    }
32
}
33