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

Attendees   A

Complexity

Total Complexity 5

Size/Duplication

Total Lines 44
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 1

Importance

Changes 8
Bugs 4 Features 1
Metric Value
wmc 5
c 8
b 4
f 1
lcom 1
cbo 1
dl 0
loc 44
rs 10

4 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 4 1
A add() 0 6 1
A toLines() 0 9 2
A getName() 0 4 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