Completed
Push — master ( 53961b...a16bad )
by Maxime
33s
created

Ratio::getTextValue()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 4
Ratio 100 %

Code Coverage

Tests 2
CRAP Score 1

Importance

Changes 1
Bugs 0 Features 1
Metric Value
dl 4
loc 4
ccs 2
cts 2
cp 1
rs 10
c 1
b 0
f 1
cc 1
eloc 2
nc 1
nop 0
crap 1
1
<?php
2
3
namespace Mhor\MediaInfo\Attribute;
4
5
use Mhor\MediaInfo\DumpTrait;
6
7 View Code Duplication
class Ratio implements AttributeInterface
0 ignored issues
show
Duplication introduced by
This class seems to be duplicated in your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
8
{
9
    use DumpTrait;
10
11
    /**
12
     * @var float
13
     */
14
    private $absoluteValue;
15
16
    /**
17
     * @var string
18
     */
19
    private $textValue;
20
21
    /**
22
     * @param string|float $absoluteValue
23
     * @param string       $textValue
24
     */
25 2
    public function __construct($absoluteValue, $textValue)
26
    {
27 2
        $this->absoluteValue = (float) $absoluteValue;
28 2
        $this->textValue = $textValue;
29 2
    }
30
31
    /**
32
     * @return float
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