Passed
Branch master (b4f9b9)
by Maxime
03:00
created

Duration   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 33
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Test Coverage

Coverage 100%

Importance

Changes 7
Bugs 2 Features 1
Metric Value
wmc 3
c 7
b 2
f 1
lcom 0
cbo 1
dl 0
loc 33
ccs 7
cts 7
cp 1
rs 10

3 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 4 1
A getMilliseconds() 0 4 1
A __toString() 0 4 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 $duration
18
     */
19 7
    public function __construct($duration)
20
    {
21 7
        $this->milliseconds = $duration;
22 7
    }
23
24
    /**
25
     * @return int
26
     */
27 4
    public function getMilliseconds()
28
    {
29 4
        return $this->milliseconds;
30
    }
31
32
    /**
33
     * @return string
34
     */
35 1
    public function __toString()
36
    {
37 1
        return (string) $this->milliseconds;
38
    }
39
}
40