Completed
Push — docs-installation-setup ( 464016 )
by Kamil
05:18
created

Interval::week()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 4
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 0
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Sylius\Component\Core\Dashboard;
6
7
final class Interval
8
{
9
    /** @var string */
10
    private $interval;
11
12
    private function __construct(string $interval)
13
    {
14
        $this->interval = $interval;
15
    }
16
17
    public function asString(): string
18
    {
19
        return $this->interval;
20
    }
21
22
    public static function year(): self
23
    {
24
        return new static('year');
25
    }
26
27
    public static function month(): self
28
    {
29
        return new static('month');
30
    }
31
32
    public static function week(): self
33
    {
34
        return new static('week');
35
    }
36
37
    public static function day(): self
38
    {
39
        return new static('day');
40
    }
41
}
42