Location::getValue()   A
last analyzed

Complexity

Conditions 2
Paths 1

Size

Total Lines 12
Code Lines 7

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 6
CRAP Score 2

Importance

Changes 0
Metric Value
c 0
b 0
f 0
dl 0
loc 12
ccs 6
cts 6
cp 1
rs 9.4285
cc 2
eloc 7
nc 1
nop 0
crap 2
1
<?php
2
/**
3
 * @author: Tamás Kovács <[email protected]>
4
 */
5
6
namespace Callisto\RequestParameter;
7
8
use Callisto\RequestParameter;
9
10
11
class Location extends RequestParameter
12
{
13
	/**
14
	 * @var string
15
	 */
16
	protected $key = 'locations';
17
18
19
	/**
20
	 * @return string
21
	 */
22
	public function getValue() : string
23
	{
24 1
		$values = array_map(function($value) {
25 1
			if (is_array($value)) {
26 1
				return implode(',', $value);
27
			}
28
29 1
			return $value;
30 1
		}, $this->value);
31
32 1
		return implode(',', $values);
33
	}
34
}
35