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

Interval   A

Complexity

Total Complexity 6

Size/Duplication

Total Lines 35
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 0

Importance

Changes 0
Metric Value
wmc 6
lcom 1
cbo 0
dl 0
loc 35
rs 10
c 0
b 0
f 0

6 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 4 1
A asString() 0 4 1
A year() 0 4 1
A month() 0 4 1
A week() 0 4 1
A day() 0 4 1
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