View::getParameters()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

Changes 0
Metric Value
cc 1
eloc 1
c 0
b 0
f 0
nc 1
nop 0
dl 0
loc 3
ccs 2
cts 2
cp 1
crap 1
rs 10
1
<?php declare(strict_types=1);
2
3
namespace jschreuder\Middle\View;
4
5
final class View implements ViewInterface
6
{
7 3
    public function __construct(
8
        private string $template,
9
        private array $parameters = [],
10
        private int $statusCode = 200,
11
        private string $contentType = self::CONTENT_TYPE_HTML,
12
        private array $headers = []
13
    )
14
    {
15 3
    }
16
17 2
    public function getStatusCode(): int
18
    {
19 2
        return $this->statusCode;
20
    }
21
22 3
    public function getHeaders(): array
23
    {
24 3
        return $this->headers;
25
    }
26
27 1
    public function setHeader(string $key, string $value): void
28
    {
29 1
        $this->headers[$key] = $value;
30
    }
31
32 2
    public function getContentType(): string
33
    {
34 2
        return $this->contentType;
35
    }
36
37 2
    public function getTemplate(): string
38
    {
39 2
        return $this->template;
40
    }
41
42 3
    public function getParameters(): array
43
    {
44 3
        return $this->parameters;
45
    }
46
47 1
    public function setParameter(string $key, $value): void
48
    {
49 1
        $this->parameters[$key] = $value;
50
    }
51
}
52