Duration::getMilliseconds()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 4

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

Changes 0
Metric Value
dl 0
loc 4
ccs 2
cts 2
cp 1
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 0
crap 1
1
<?php
2
3
namespace Mhor\MediaInfo\Attribute;
4
5
use Mhor\MediaInfo\DumpTrait;
6
7
class Duration implements AttributeInterface
8
{
9
    use DumpTrait;
10
11
    /**
12
     * @var int
13
     */
14
    private $milliseconds;
15
16
    /**
17
     * @param string|int $duration
18
     */
19 14
    public function __construct($duration)
20
    {
21 14
        $this->milliseconds = (int) $duration;
22 14
    }
23
24
    /**
25
     * @return int
26
     */
27 4
    public function getMilliseconds(): int
28
    {
29 4
        return $this->milliseconds;
30
    }
31
32
    /**
33
     * @return string
34
     */
35 1
    public function __toString(): string
36
    {
37 1
        return (string) $this->milliseconds;
38
    }
39
}
40