HttpResponseHeader::getCode()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 4
Ratio 100 %

Code Coverage

Tests 1
CRAP Score 1

Importance

Changes 0
Metric Value
dl 4
loc 4
ccs 1
cts 1
cp 1
rs 10
c 0
b 0
f 0
cc 1
eloc 2
nc 1
nop 0
crap 1
1
<?php
2
/**
3
 * Author: Jairo Rodríguez <[email protected]>
4
 *
5
 * For the full copyright and license information, please view the LICENSE
6
 * file that was distributed with this source code.
7
 */
8
9
namespace BFunky\HttpParser\Entity;
10
11 View Code Duplication
class HttpResponseHeader implements HttpHeaderInterface
0 ignored issues
show
Duplication introduced by
This class seems to be duplicated in your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
12
{
13
    /**
14
     * @var string
15
     */
16
    protected $protocol;
17
18
    /**
19
     * @var string
20
     */
21
    protected $code;
22
23
    /**
24
     * @var string
25
     */
26
    protected $message;
27
28
    /**
29
     * HttpResponseHeader constructor.
30
     * @param string $protocol
31
     * @param string $code
32 2
     * @param string $message
33
     */
34 2
    public function __construct(string $protocol, string $code, string $message)
35 2
    {
36 2
        $this->protocol = $protocol;
37 2
        $this->code = $code;
38
        $this->message = $message;
39
    }
40
41
    /**
42 2
     * @return string
43
     */
44 2
    public function getProtocol(): string
45
    {
46
        return $this->protocol;
47
    }
48
49
    /**
50
     * @param string $protocol
51 1
     * @return HttpResponseHeader
52
     */
53 1
    public function setProtocol(string $protocol): HttpResponseHeader
54 1
    {
55
        $this->protocol = $protocol;
56
        return $this;
57
    }
58
59
    /**
60 2
     * @return string
61
     */
62 2
    public function getCode(): string
63
    {
64
        return $this->code;
65
    }
66
67
    /**
68
     * @param string $code
69 1
     * @return HttpResponseHeader
70
     */
71 1
    public function setCode(string $code): HttpResponseHeader
72 1
    {
73
        $this->code = $code;
74
        return $this;
75
    }
76
77
    /**
78 2
     * @return string
79
     */
80 2
    public function getMessage(): string
81
    {
82
        return $this->message;
83
    }
84
85
    /**
86
     * @param string $message
87 1
     * @return HttpResponseHeader
88
     */
89 1
    public function setMessage(string $message): HttpResponseHeader
90 1
    {
91
        $this->message = $message;
92
        return $this;
93
    }
94
}