RequestParameter::getValue()   A
last analyzed

Complexity

Conditions 2
Paths 2

Size

Total Lines 8
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 4
CRAP Score 2

Importance

Changes 0
Metric Value
c 0
b 0
f 0
dl 0
loc 8
ccs 4
cts 4
cp 1
rs 9.4285
cc 2
eloc 4
nc 2
nop 0
crap 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
}