-
Notifications
You must be signed in to change notification settings - Fork 23
Expand file tree
/
Copy pathRate.php
More file actions
38 lines (29 loc) · 717 Bytes
/
Rate.php
File metadata and controls
38 lines (29 loc) · 717 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
<?php
namespace Mhor\MediaInfo\Attribute;
use Mhor\MediaInfo\DumpTrait;
class Rate implements AttributeInterface
{
use DumpTrait;
protected float $absoluteValue;
protected string $textValue;
/**
* @param string|int $absoluteValue
*/
public function __construct($absoluteValue, string $textValue)
{
$this->absoluteValue = (float) $absoluteValue;
$this->textValue = $textValue;
}
public function getAbsoluteValue(): int
{
return round($this->absoluteValue);
}
public function getTextValue(): string
{
return $this->textValue;
}
public function __toString(): string
{
return $this->textValue;
}
}