ResponseBuilder::getHeaders()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 1
c 1
b 0
f 0
nc 1
nop 0
dl 0
loc 3
ccs 0
cts 2
cp 0
crap 2
rs 10
1
<?php
2
/**
3
 * This file is part of the Divergence package.
4
 *
5
 * (c) Henry Paradiz <[email protected]>
6
 *
7
 * For the full copyright and license information, please view the LICENSE
8
 * file that was distributed with this source code.
9
 */
10
11
namespace Divergence\Responders;
12
13
use Psr\Http\Message\StreamInterface;
14
15
abstract class ResponseBuilder
16
{
17
    protected $template;
18
    protected string $contentType = '';
19
    protected array $headers;
20
    protected array $data;
21
22 69
    public function __construct($template, $data = [], $headers = [])
23
    {
24 69
        $this->template = $template;
25 69
        $this->data = $data;
26 69
        $this->headers = $headers;
27
    }
28
29
    public function getHeaders(): array
30
    {
31
        return $this->headers;
32
    }
33
34
35 65
    public function getContentType(): string
36
    {
37 65
        return $this->contentType;
38
    }
39
40
    abstract public function getBody(): StreamInterface;
41
}
42