Completed
Push — master ( 5db245...cdc2ed )
by Markus
17s queued 14s
created

ArrayValue::setValues()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 6
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 3
CRAP Score 1

Importance

Changes 0
Metric Value
dl 0
loc 6
ccs 3
cts 3
cp 1
rs 9.4285
c 0
b 0
f 0
cc 1
eloc 3
nc 1
nop 1
crap 1
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
class ArrayValue implements ValueInterface
15
{
16
    /**
17
     * The value.
18
     *
19
     * @var array
20
     */
21
    protected $values;
22
23 11
    public function __construct(array $values)
24
    {
25 11
        $this->values = $values;
26 11
    }
27
28 4
    public function setValues(array $values)
29
    {
30 4
        $this->values = $values;
31
32 4
        return $this;
33
    }
34
35
    public function getEscapedValue(): string
36
    {
37 9
        return implode(',', array_map(function (string $value): string {
38 7
            return (new StringValue($value))->getEscapedValue();
39 9
        }, $this->values));
40
    }
41
}
42