PopularChannelsRequest   A
last analyzed

Complexity

Total Complexity 5

Size/Duplication

Total Lines 47
Duplicated Lines 0 %

Test Coverage

Coverage 63.64%

Importance

Changes 1
Bugs 0 Features 1
Metric Value
eloc 10
c 1
b 0
f 1
dl 0
loc 47
rs 10
ccs 7
cts 11
cp 0.6364
wmc 5

3 Methods

Rating   Name   Duplication   Size   Complexity  
A getLimit() 0 3 1
A getUserName() 0 3 1
A __construct() 0 10 3
1
<?php
2
3
namespace Jalle19\StatusManager\Message\Request;
4
5
/**
6
 * Class PopularChannelsRequest
7
 * @package   Jalle19\StatusManager\Message\Request
8
 * @copyright Copyright &copy; Sam Stenvall 2016-
9
 * @license   https://www.gnu.org/licenses/gpl.html The GNU General Public License v2.0
10
 */
11
class PopularChannelsRequest extends StatisticsRequest
12
{
13
14
	/**
15
	 * @var string
16
	 */
17
	private $_userName;
18
19
	/**
20
	 * @var int
21
	 */
22
	private $_limit;
23
24
25
	/**
26
	 * PopularChannelsRequest constructor.
27
	 *
28
	 * @param \stdClass $parameters
29
	 */
30 2
	public function __construct($parameters)
31
	{
32 2
		parent::__construct(self::TYPE_POPULAR_CHANNELS_REQUEST, $parameters);
33
34
		/* @var \stdClass $parameters */
35 1
		if (isset($parameters->limit))
36 1
			$this->_limit = $parameters->limit;
37
38 1
		if (isset($parameters->userName))
39 1
			$this->_userName = $parameters->userName;
40 1
	}
41
42
43
	/**
44
	 * @return string
45
	 */
46
	public function getUserName()
47
	{
48
		return $this->_userName;
49
	}
50
51
52
	/**
53
	 * @return int
54
	 */
55
	public function getLimit()
56
	{
57
		return $this->_limit;
58
	}
59
60
}
61