| Total Complexity | 2 |
| Total Lines | 28 |
| Duplicated Lines | 0 % |
| Coverage | 100% |
| Changes | 0 | ||
| 1 | <?php |
||
| 33 | class Number extends ValueObject |
||
| 34 | { |
||
| 35 | use SanitizesNumbers; |
||
| 36 | |||
| 37 | /** |
||
| 38 | * @var BigNumber |
||
| 39 | */ |
||
| 40 | protected BigNumber $number; |
||
| 41 | |||
| 42 | /** |
||
| 43 | * Create a new instance of the value object. |
||
| 44 | * |
||
| 45 | * @param int|string $number |
||
| 46 | * @param int $scale |
||
| 47 | */ |
||
| 48 | 13 | public function __construct(int|string $number, protected int $scale = 2) |
|
| 49 | { |
||
| 50 | 13 | $this->number = new BigNumber($this->sanitize($number), $this->scale); |
|
| 51 | } |
||
| 52 | |||
| 53 | /** |
||
| 54 | * Get the object value. |
||
| 55 | * |
||
| 56 | * @return string |
||
| 57 | */ |
||
| 58 | 9 | public function value(): string |
|
| 61 | } |
||
| 62 | } |
||
| 63 |