RequestParameter   A
last analyzed

Complexity

Total Complexity 4

Size/Duplication

Total Lines 42
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 0

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
wmc 4
c 0
b 0
f 0
lcom 1
cbo 0
dl 0
loc 42
ccs 9
cts 9
cp 1
rs 10

3 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 4 1
A getKey() 0 4 1
A getValue() 0 8 2
1
<?php
2
/**
3
 * Created by PhpStorm.
4
 * User: tamaskovacs
5
 * Date: 2017. 01. 14.
6
 * Time: 16:11
7
 */
8
9
namespace Callisto;
10
11
12
/**
13
 * Class BaseFilter
14
 * @package Callisto
15
 */
16
abstract class RequestParameter
17
{
18
	/**
19
	 * @var string
20
	 */
21
	protected $key;
22
23
	/**
24
	 * @var array
25
	 */
26
	protected $value;
27
28
29
	/**
30
	 * BaseFilter constructor.
31
	 * @param array $value
32
	 */
33 4
	public function __construct($value)
34
	{
35 4
		$this->value = $value;
36 4
	}
37
38
	/**
39
	 * @return string
40
	 */
41 3
	public function getKey() : string
42
	{
43 3
		return $this->key;
44
	}
45
46
	/**
47
	 * @return string
48
	 */
49 2
	public function getValue() : string
50
	{
51 2
		if (is_array($this->value)) {
52 1
			return implode(',', $this->value);
53
		}
54
55 1
		return $this->value;
56
	}
57
}