Code Duplication    Length = 48-48 lines in 2 locations

src/Attribute/Rate.php 1 location

@@ 7-54 (lines=48) @@
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 string|int $absoluteValue
23
     * @param string     $textValue
24
     */
25
    public function __construct($absoluteValue, string $textValue)
26
    {
27
        $this->absoluteValue = (int) $absoluteValue;
28
        $this->textValue = $textValue;
29
    }
30
31
    /**
32
     * @return int
33
     */
34
    public function getAbsoluteValue(): int
35
    {
36
        return $this->absoluteValue;
37
    }
38
39
    /**
40
     * @return string
41
     */
42
    public function getTextValue(): string
43
    {
44
        return $this->textValue;
45
    }
46
47
    /**
48
     * @return string
49
     */
50
    public function __toString(): string
51
    {
52
        return $this->textValue;
53
    }
54
}
55

src/Attribute/Ratio.php 1 location

@@ 7-54 (lines=48) @@
4
5
use Mhor\MediaInfo\DumpTrait;
6
7
class Ratio implements AttributeInterface
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
    public function __construct($absoluteValue, string $textValue)
26
    {
27
        $this->absoluteValue = (float) $absoluteValue;
28
        $this->textValue = $textValue;
29
    }
30
31
    /**
32
     * @return float
33
     */
34
    public function getAbsoluteValue(): float
35
    {
36
        return $this->absoluteValue;
37
    }
38
39
    /**
40
     * @return string
41
     */
42
    public function getTextValue(): string
43
    {
44
        return $this->textValue;
45
    }
46
47
    /**
48
     * @return string
49
     */
50
    public function __toString(): string
51
    {
52
        return $this->textValue;
53
    }
54
}
55