DefaultOutputWriter   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 26
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

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

3 Methods

Rating   Name   Duplication   Size   Complexity  
A sendHeader() 0 3 1
A sendData() 0 3 1
A setResponseCode() 0 3 1
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