Passed
Push — main ( 83e8ed...8c5b75 )
by Thomas
13:12
created

WrapsMessage::getHeaders()   A

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 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 2
cts 2
cp 1
crap 1
rs 10
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Conia\Http;
6
7
use Psr\Http\Message\StreamInterface as PsrStream;
8
9
trait WrapsMessage
10
{
11 1
    public function getProtocolVersion(): string
12
    {
13 1
        return $this->psr->getProtocolVersion();
14
    }
15
16
    public function withProtocolVersion(string $version): static
17
    {
18
        $this->psr = $this->psr->withProtocolVersion($version);
0 ignored issues
show
Bug Best Practice introduced by
The property psr does not exist. Although not strictly required by PHP, it is generally a best practice to declare properties explicitly.
Loading history...
19
20
        return $this;
21
    }
22
23 1
    public function getHeaders(): array
24
    {
25 1
        return $this->psr->getHeaders();
26
    }
27
28 1
    public function hasHeader(string $header): bool
29
    {
30 1
        return $this->psr->hasHeader($header);
31
    }
32
33 1
    public function getHeader(string $header): array
34
    {
35 1
        return $this->psr->getHeader($header);
36
    }
37
38 2
    public function getHeaderLine(string $header): string
39
    {
40 2
        return $this->psr->getHeaderLine($header);
41
    }
42
43
    public function withHeader(string $header, string $value): static
44
    {
45
        $this->psr = $this->psr->withHeader($header, $value);
0 ignored issues
show
Bug Best Practice introduced by
The property psr does not exist. Although not strictly required by PHP, it is generally a best practice to declare properties explicitly.
Loading history...
46
47
        return $this;
48
    }
49
50
    public function withAddedHeader(string $header, string $value): static
51
    {
52
        $this->psr = $this->psr->withAddedHeader($header, $value);
0 ignored issues
show
Bug Best Practice introduced by
The property psr does not exist. Although not strictly required by PHP, it is generally a best practice to declare properties explicitly.
Loading history...
53
54
        return $this;
55
    }
56
57 1
    public function withoutHeader(string $header): static
58
    {
59 1
        $this->psr = $this->psr->withoutHeader($header);
0 ignored issues
show
Bug Best Practice introduced by
The property psr does not exist. Although not strictly required by PHP, it is generally a best practice to declare properties explicitly.
Loading history...
60
61 1
        return $this;
62
    }
63
64 1
    public function getBody(): PsrStream
65
    {
66 1
        return $this->psr->getBody();
67
    }
68
69 1
    public function withBody(PsrStream $body): static
70
    {
71 1
        $this->psr = $this->psr->withBody($body);
0 ignored issues
show
Bug Best Practice introduced by
The property psr does not exist. Although not strictly required by PHP, it is generally a best practice to declare properties explicitly.
Loading history...
72
73 1
        return $this;
74
    }
75
}
76