Completed
Push — master ( 2e6749...8bcd18 )
by Sam
02:24
created

PopularChannelsRequest   A

Complexity

Total Complexity 5

Size/Duplication

Total Lines 50
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Importance

Changes 3
Bugs 0 Features 2
Metric Value
wmc 5
c 3
b 0
f 2
lcom 0
cbo 1
dl 0
loc 50
rs 10

3 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 11 3
A getUserName() 0 4 1
A getLimit() 0 4 1
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 string $parameters
29
	 */
30
	public function __construct($parameters)
31
	{
32
		parent::__construct(self::TYPE_POPULAR_CHANNELS_REQUEST, $parameters);
33
34
		/* @var \stdClass $parameters */
35
		if (isset($parameters->limit))
36
			$this->_limit = $parameters->limit;
37
38
		if (isset($parameters->userName))
39
			$this->_userName = $parameters->userName;
40
	}
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