Passed
Push — master ( aa3afb...6d9795 )
by Damien
02:45
created

Duration::getFormattedValue()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 1
c 0
b 0
f 0
nc 1
nop 0
dl 0
loc 3
rs 10
1
<?php
2
3
namespace DH\NavigationBundle\Model;
4
5
use DH\NavigationBundle\Helper\FormatHelper;
6
7
class Duration
8
{
9
    /**
10
     * @var int
11
     */
12
    private $value;
13
14
    public function __construct(int $value)
15
    {
16
        $this->value = $value;
17
    }
18
19
    /**
20
     * @return string
21
     */
22
    public function getFormattedValue(): string
23
    {
24
        return FormatHelper::formatTime($this->value);
25
    }
26
27
    /**
28
     * @return int
29
     */
30
    public function getValue(): int
31
    {
32
        return $this->value;
33
    }
34
35
    /**
36
     * @return string
37
     */
38
    public function __toString(): string
39
    {
40
        return $this->getFormattedValue();
41
    }
42
}
43