| Total Complexity | 2 |
| Total Lines | 27 |
| Duplicated Lines | 0 % |
| Coverage | 100% |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 14 | class Integer extends ValueObject |
||
| 15 | { |
||
| 16 | use SanitizesNumbers; |
||
| 17 | |||
| 18 | /** |
||
| 19 | * @var BigNumber |
||
| 20 | */ |
||
| 21 | protected BigNumber $number; |
||
| 22 | |||
| 23 | /** |
||
| 24 | * Create a new instance of the value object. |
||
| 25 | * |
||
| 26 | * @param int|float|string|null $number |
||
| 27 | */ |
||
| 28 | 11 | public function __construct(int|float|string|null $number) |
|
| 29 | { |
||
| 30 | 11 | $this->number = new BigNumber($this->sanitize($number), 0); |
|
| 31 | } |
||
| 32 | |||
| 33 | /** |
||
| 34 | * Get the object value. |
||
| 35 | * |
||
| 36 | * @return int |
||
| 37 | */ |
||
| 38 | 10 | public function value(): int |
|
| 41 | } |
||
| 42 | } |
||
| 43 |