Passed
Pull Request — master (#1005)
by Fabio
17:26 queued 11:05
created

THttpHeader   A

Complexity

Total Complexity 7

Size/Duplication

Total Lines 74
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 11
c 1
b 0
f 0
dl 0
loc 74
rs 10
wmc 7

7 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 4 1
A getManager() 0 3 1
A getValue() 0 3 1
A getName() 0 3 1
A init() 0 2 1
A setValue() 0 3 1
A setName() 0 3 1
1
<?php
2
3
/**
4
 * THttpHeader class file
5
 *
6
 * @author Fabio Bas <ctrlaltca[at]gmail[dot]com>
7
 * @link https://github.com/pradosoft/prado
8
 * @license https://github.com/pradosoft/prado/blob/master/LICENSE
9
 */
10
11
namespace Prado\Web;
12
13
/**
14
 * THttpHeader class
15
 *
16
 * THttpHeader is a class representing a simple HTTP header
17
 * in the form of a Name and a textual Value.
18
 *
19
 * @author Fabio Bas <ctrlaltca[at]gmail[dot]com>
20
 * @since 4.3.2
21
 */
22
class THttpHeader extends \Prado\TComponent
23
{
24
	/**
25
	 * @var THttpHeadersManager the URL manager instance
26
	 */
27
	private $_manager;
28
	/**
29
	 * @var string Name
30
	 */
31
	protected $_name;
32
33
	/**
34
	 * @var string Value
35
	 */
36
	protected $_value;
37
38
	/**
39
	 * Constructor.
40
	 * @param THttpHeadersManager $manager the headers manager instance
41
	 */
42
	public function __construct(THttpHeadersManager $manager)
43
	{
44
		$this->_manager = $manager;
45
		parent::__construct();
46
	}
47
48
	/**
49
	 * @return THttpHeadersManager the URL manager instance
50
	 */
51
	public function getManager()
52
	{
53
		return $this->_manager;
54
	}
55
56
	/**
57
	 * Initializes the header.
58
	 * @param \Prado\Xml\TXmlElement $config configuration for this module.
59
	 */
60
	public function init($config)
0 ignored issues
show
Unused Code introduced by
The parameter $config is not used and could be removed. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-unused  annotation

60
	public function init(/** @scrutinizer ignore-unused */ $config)

This check looks for parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
61
	{
62
	}
63
64
	/**
65
	 * @return string the textual name of the header.
66
	 */
67
	public function getName()
68
	{
69
		return $this->_name;
70
	}
71
72
	/**
73
	 * Sets the textual name of the header
74
	 * @param string $name the texttual name
75
	 */
76
	public function setName($name)
77
	{
78
		$this->_name = $name;
79
	}
80
81
	/**
82
	 * @return string the textual value of the header.
83
	 */
84
	public function getValue()
85
	{
86
		return $this->_value;
87
	}
88
89
	/**
90
	 * Sets the textual value of the header
91
	 * @param string $value the texttual value
92
	 */
93
	public function setValue($value)
94
	{
95
		$this->_value = $value;
96
	}
97
}
98