Completed
Push — master ( ce7b38...6ec792 )
by Peter
04:34
created

SimpleUri::setChangeFreq()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 6
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 0
Metric Value
c 0
b 0
f 0
dl 0
loc 6
ccs 0
cts 5
cp 0
rs 9.4285
cc 1
eloc 3
nc 1
nop 1
crap 2
1
<?php
2
/**
3
 * GpsLab component.
4
 *
5
 * @author    Peter Gribanov <[email protected]>
6
 * @copyright Copyright (c) 2011, Peter Gribanov
7
 * @license   http://opensource.org/licenses/MIT
8
 */
9
namespace GpsLab\Component\Sitemap\Uri;
10
11
class SimpleUri implements UriInterface
12
{
13
    /**
14
     * @var string
15
     */
16
    protected $loc = '';
17
18
    /**
19
     * @var \DateTime
20
     */
21
    protected $last_mod;
22
23
    /**
24
     * @var string
25
     */
26
    protected $change_freq = self::DEFAULT_CHANGE_FREQ;
27
28
    /**
29
     * @var string
30
     */
31
    protected $priority = self::DEFAULT_PRIORITY;
32
33
    public function __construct($loc)
34
    {
35
        $this->loc = $loc;
36
        $this->last_mod = new \DateTime();
37
    }
38
39
    /**
40
     * @return string
41
     */
42
    public function getLoc()
43
    {
44
        return $this->loc;
45
    }
46
47
    /**
48
     * @return \DateTime
49
     */
50
    public function getLastMod()
51
    {
52
        return clone $this->last_mod;
53
    }
54
55
    /**
56
     * @param \DateTime $last_mod
57
     *
58
     * @return SimpleUri
59
     */
60
    public function setLastMod(\DateTime $last_mod)
61
    {
62
        $this->last_mod = clone $last_mod;
63
64
        return $this;
65
    }
66
67
    /**
68
     * @return string
69
     */
70
    public function getChangeFreq()
71
    {
72
        return $this->change_freq;
73
    }
74
75
    /**
76
     * @param string $change_freq
77
     *
78
     * @return SimpleUri
79
     */
80
    public function setChangeFreq($change_freq)
81
    {
82
        $this->change_freq = $change_freq;
83
84
        return $this;
85
    }
86
87
    /**
88
     * @return string
89
     */
90
    public function getPriority()
91
    {
92
        return $this->priority;
93
    }
94
95
    /**
96
     * @param string $priority
97
     *
98
     * @return SimpleUri
99
     */
100
    public function setPriority($priority)
101
    {
102
        $this->priority = $priority;
103
104
        return $this;
105
    }
106
}
107