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

Timezone::__construct()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 0
loc 4
rs 10
nc 1
cc 1
eloc 2
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\Component;
13
14
use Eluceo\iCal\Component;
15
use Eluceo\iCal\PropertyBag;
16
17
/**
18
 * Implementation of the TIMEZONE component.
19
 */
20
class Timezone extends Component
21
{
22
    /**
23
     * @var string
24
     */
25
    protected $timezone;
26
27
    public function __construct($timezone)
28
    {
29
        $this->timezone = $timezone;
30
    }
31
32
    /**
33
     * {@inheritdoc}
34
     */
35
    public function getType()
36
    {
37
        return 'VTIMEZONE';
38
    }
39
40
    /**
41
     * {@inheritdoc}
42
     */
43
    public function buildPropertyBag()
44
    {
45
        $propertyBag = new PropertyBag();
46
47
        $propertyBag->set('TZID', $this->timezone);
48
        $propertyBag->set('X-LIC-LOCATION', $this->timezone);
49
50
        return $propertyBag;
51
    }
52
53
    public function getZoneIdentifier()
54
    {
55
        return $this->timezone;
56
    }
57
}
58