Completed
Push — master ( ee3f46...2dd99c )
by Markus
03:13
created

ArrayValue::setValues()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 6
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 1
Bugs 0 Features 1
Metric Value
c 1
b 0
f 1
dl 0
loc 6
ccs 0
cts 3
cp 0
rs 9.4285
cc 1
eloc 3
nc 1
nop 1
crap 2
1
<?php
2
3
/*
4
 * This file is part of the eluceo/iCal package.
5
 *
6
 * (c) Markus Poerschke <[email protected]>
7
 *
8
 * This source file is subject to the MIT license that is bundled
9
 * with this source code in the file LICENSE.
10
 */
11
12
namespace Eluceo\iCal\Property;
13
14
use Eluceo\iCal\Util\PropertyValueUtil;
15
16
class ArrayValue implements ValueInterface
17
{
18
    /**
19
     * The value.
20
     *
21
     * @var array
22
     */
23
    protected $values;
24
25 4
    public function __construct(array $values)
26
    {
27 4
        $this->values = $values;
28 4
    }
29
30
    public function setValues(array $values)
31
    {
32
        $this->values = $values;
33
34
        return $this;
35
    }
36
37
    public function getEscapedValue()
38
    {
39 4
        return implode(',', array_map(function ($value) {
40 3
            return PropertyValueUtil::escapeValue((string) $value);
41 4
        }, $this->values));
42
    }
43
}
44