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 $method;
17
18
/**
19
* @var string
20
*/
21
protected $path;
22
23
/**
24
* @var string
25
*/
26
protected $protocol;
27
28
/**
29
* HttpRequestHeader constructor.
30
* @param string $method
31
* @param string $path
32
2
* @param string $protocol
33
*/
34
2
public function __construct(string $method, string $path, string $protocol)
35
2
{
36
2
$this->method = $method;
37
2
$this->path = $path;
38
$this->protocol = $protocol;
39
}
40
41
42
/**
43
2
* @return string
44
*/
45
2
public function getMethod(): string
46
{
47
return $this->method;
48
}
49
50
/**
51
* @param string $method
52
1
* @return HttpRequestHeader
53
*/
54
1
public function setMethod(string $method): HttpRequestHeader
55
1
{
56
$this->method = $method;
57
return $this;
58
}
59
60
/**
61
2
* @return string
62
*/
63
2
public function getPath(): string
64
{
65
return $this->path;
66
}
67
68
/**
69
* @param string $path
70
1
* @return HttpRequestHeader
71
*/
72
1
public function setPath(string $path): HttpRequestHeader
73
1
{
74
$this->path = $path;
75
return $this;
76
}
77
78
/**
79
2
* @return string
80
*/
81
2
public function getProtocol(): string
82
{
83
return $this->protocol;
84
}
85
86
/**
87
* @param string $protocol
88
1
* @return HttpRequestHeader
89
*/
90
1
public function setProtocol(string $protocol): HttpRequestHeader
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.