Completed
Push — master ( da2f6e...d3b8cb )
by Kamil
20:06
created

ChangeFrequency   A

Complexity

Total Complexity 9

Size/Duplication

Total Lines 79
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 0
Metric Value
wmc 9
lcom 1
cbo 0
dl 0
loc 79
rs 10

9 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 4 1
A __toString() 0 4 1
A always() 0 4 1
A hourly() 0 4 1
A daily() 0 4 1
A weekly() 0 4 1
A monthly() 0 4 1
A yearly() 0 4 1
A never() 0 4 1
1
<?php
2
3
/*
4
 * This file is part of the Sylius package.
5
 *
6
 * (c) Paweł Jędrzejewski
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 Sylius\Bundle\CoreBundle\Sitemap\Model;
13
14
/**
15
 * @author Arkadiusz Krakowiak <[email protected]>
16
 */
17
final class ChangeFrequency
18
{
19
    /**
20
     * @var string
21
     */
22
    private $value;
23
24
    /**
25
     * @param string $changeFrequency
26
     */
27
    private function __construct($changeFrequency)
28
    {
29
        $this->value = $changeFrequency;
30
    }
31
32
    /**
33
     * @return string
34
     */
35
    public function __toString()
36
    {
37
        return $this->value;
38
    }
39
40
    /**
41
     * @return ChangeFrequency
42
     */
43
    public static function always()
44
    {
45
        return new self('always');
46
    }
47
48
    /**
49
     * @return ChangeFrequency
50
     */
51
    public static function hourly()
52
    {
53
        return new self('hourly');
54
    }
55
56
    /**
57
     * @return ChangeFrequency
58
     */
59
    public static function daily()
60
    {
61
        return new self('daily');
62
    }
63
64
    /**
65
     * @return ChangeFrequency
66
     */
67
    public static function weekly()
68
    {
69
        return new self('weekly');
70
    }
71
72
    /**
73
     * @return ChangeFrequency
74
     */
75
    public static function monthly()
76
    {
77
        return new self('monthly');
78
    }
79
80
    /**
81
     * @return ChangeFrequency
82
     */
83
    public static function yearly()
84
    {
85
        return new self('yearly');
86
    }
87
88
    /**
89
     * @return ChangeFrequency
90
     */
91
    public static function never()
92
    {
93
        return new self('never');
94
    }
95
}
96