Completed
Push — 1.x ( 29da9d...c4a6b5 )
by Markus
03:09
created

Attendees::setValue()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 6
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 2
Bugs 2 Features 1
Metric Value
c 2
b 2
f 1
dl 0
loc 6
rs 9.4285
cc 1
eloc 3
nc 1
nop 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\Event;
13
14
use Eluceo\iCal\Property;
15
16
class Attendees extends Property
17
{
18
    /** @var Property[] */
19
    protected $attendees = [];
20
21
    public function __construct()
22
    {
23
        // Overwrites constructor functionality of Property
24
    }
25
26
    /**
27
     * @param       $value
28
     * @param array $params
29
     *
30
     * @return $this
31
     */
32
    public function add($value, $params = [])
33
    {
34
        $this->attendees[] = new Property('ATTENDEE', $value, $params);
35
36
        return $this;
37
    }
38
39
    /**
40
     * {@inheritdoc}
41
     */
42
    public function toLines()
43
    {
44
        $lines = [];
45
        foreach ($this->attendees as $attendee) {
46
            $lines[] = $attendee->toLine();
47
        }
48
49
        return $lines;
50
    }
51
52
    /**
53
     * {@inheritdoc}
54
     */
55
    public function getName()
56
    {
57
        return 'ATTENDEES';
58
    }
59
}
60