Url   A
last analyzed

Complexity

Total Complexity 5

Size/Duplication

Total Lines 85
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Importance

Changes 0
Metric Value
wmc 5
lcom 0
cbo 0
dl 0
loc 85
rs 10
c 0
b 0
f 0

5 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 7 1
A getChangeFreq() 0 4 1
A getLastMod() 0 4 1
A getLoc() 0 4 1
A getPriority() 0 4 1
1
<?php
2
3
declare(strict_types=1);
4
5
/*
6
 * (c) Christian Gripp <[email protected]>
7
 *
8
 * For the full copyright and license information, please view the LICENSE
9
 * file that was distributed with this source code.
10
 */
11
12
namespace Core23\SitemapBundle\Model;
13
14
final class Url implements UrlInterface
15
{
16
    /**
17
     * Always visit url.
18
     */
19
    public const FREQUENCE_ALWAYS = 'always';
20
21
    /**
22
     * Visit url every hour.
23
     */
24
    public const FREQUENCE_HOURLY = 'hourly';
25
26
    /**
27
     * Visit url every day.
28
     */
29
    public const FREQUENCE_DAILY = 'daily';
30
31
    /**
32
     * Visit url every week.
33
     */
34
    public const FREQUENCE_WEEKLY = 'weekly';
35
36
    /**
37
     * Visit url every month.
38
     */
39
    public const FREQUENCE_MONTHLY = 'monthly';
40
41
    /**
42
     * Visit url every year.
43
     */
44
    public const FREQUENCE_YEARLY = 'yearly';
45
46
    /**
47
     * Never visit url again.
48
     */
49
    public const FREQUENCE_NEVER = 'never';
50
51
    /**
52
     * @var string
53
     */
54
    private $loc;
55
56
    /**
57
     * @var \DateTime|null
58
     */
59
    private $lastMod;
60
61
    /**
62
     * @var string|null
63
     */
64
    private $changeFreq;
65
66
    /**
67
     * @var int|null
68
     */
69
    private $priority;
70
71
    public function __construct(string $loc, ?int $priority = null, ?string $changeFreq = null, ?\DateTime $lastMod = null)
72
    {
73
        $this->loc        = $loc;
74
        $this->lastMod    = $lastMod;
75
        $this->changeFreq = $changeFreq;
76
        $this->priority   = $priority;
77
    }
78
79
    public function getChangeFreq(): ?string
80
    {
81
        return $this->changeFreq;
82
    }
83
84
    public function getLastMod(): ?\DateTime
85
    {
86
        return $this->lastMod;
87
    }
88
89
    public function getLoc(): string
90
    {
91
        return $this->loc;
92
    }
93
94
    public function getPriority(): ?int
95
    {
96
        return $this->priority;
97
    }
98
}
99