Passed
Push — master ( 8372c2...433919 )
by Tamás
02:18
created

RequestParameter   A

Complexity

Total Complexity 4

Size/Duplication

Total Lines 42
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 0

Test Coverage

Coverage 33.33%

Importance

Changes 0
Metric Value
wmc 4
lcom 1
cbo 0
dl 0
loc 42
c 0
b 0
f 0
ccs 3
cts 9
cp 0.3333
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 1
	public function __construct($value)
34
	{
35 1
		$this->value = $value;
36 1
	}
37
38
	/**
39
	 * @return string
40
	 */
41
	public function getKey() : string
42
	{
43
		return $this->key;
44
	}
45
46
	/**
47
	 * @return string
48
	 */
49
	public function getValue() : string
50
	{
51
		if (is_array($this->value)) {
52
			return implode(',', $this->value);
53
		}
54
55
		return $this->value;
56
	}
57
}