RequestParameter::__construct()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 3
CRAP Score 1

Importance

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