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

Rate::__construct()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 5
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 4
CRAP Score 1

Importance

Changes 4
Bugs 1 Features 0
Metric Value
c 4
b 1
f 0
dl 0
loc 5
ccs 4
cts 4
cp 1
rs 9.4285
cc 1
eloc 3
nc 1
nop 2
crap 1
1
<?php
2
3
namespace Mhor\MediaInfo\Attribute;
4
5
use Mhor\MediaInfo\DumpTrait;
6
7
class Rate implements AttributeInterface
8
{
9
    use DumpTrait;
10
11
    /**
12
     * @var int
13
     */
14
    private $absoluteValue;
15
16
    /**
17
     * @var string
18
     */
19
    private $textValue;
20
21
    /**
22
     * @param $absoluteValue
23
     * @param $textValue
24
     */
25 4
    public function __construct($absoluteValue, $textValue)
26
    {
27 4
        $this->absoluteValue = $absoluteValue;
28 4
        $this->textValue = $textValue;
29 4
    }
30
31
    /**
32
     * @return int
33
     */
34 1
    public function getAbsoluteValue()
35
    {
36 1
        return $this->absoluteValue;
37
    }
38
39
    /**
40
     * @return string
41
     */
42 1
    public function getTextValue()
43
    {
44 1
        return $this->textValue;
45
    }
46
47
    /**
48
     * @return string
49
     */
50 1
    public function __toString()
51
    {
52 1
        return $this->textValue;
53
    }
54
}
55