Timezone::getZoneIdentifier()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 4

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

Changes 0
Metric Value
dl 0
loc 4
ccs 2
cts 2
cp 1
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 0
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\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 2
    public function __construct($timezone)
28
    {
29 2
        $this->timezone = $timezone;
30 2
    }
31
32
    /**
33
     * {@inheritdoc}
34
     */
35 2
    public function getType()
36
    {
37 2
        return 'VTIMEZONE';
38
    }
39
40
    /**
41
     * {@inheritdoc}
42
     */
43 2
    public function buildPropertyBag()
44
    {
45 2
        $propertyBag = new PropertyBag();
46
47 2
        $propertyBag->set('TZID', $this->timezone);
48 2
        $propertyBag->set('X-LIC-LOCATION', $this->timezone);
49
50 2
        return $propertyBag;
51
    }
52
53 1
    public function getZoneIdentifier()
54
    {
55 1
        return $this->timezone;
56
    }
57
}
58