Total Complexity | 5 |
Total Lines | 35 |
Duplicated Lines | 0 % |
Coverage | 100% |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
10 | class Moneda extends AbstractEntryIdentifiable |
||
11 | { |
||
12 | /** @var int */ |
||
13 | private $decimales; |
||
14 | |||
15 | /** @var int */ |
||
16 | private $porcentajeVariacion; |
||
17 | |||
18 | 4 | public function __construct( |
|
19 | string $id, |
||
20 | string $texto, |
||
21 | int $decimales, |
||
22 | int $porcentajeVariacion, |
||
23 | int $vigenteDesde, |
||
24 | int $vigenteHasta |
||
25 | ) { |
||
26 | 4 | parent::__construct($id, $texto, $vigenteDesde, $vigenteHasta); |
|
27 | 4 | if ($decimales < 0) { |
|
28 | 1 | throw new SatCatalogosLogicException('El campo decimales no puede ser menor a cero'); |
|
29 | } |
||
30 | 3 | if ($porcentajeVariacion < 0) { |
|
31 | 1 | throw new SatCatalogosLogicException('El campo porcentaje de variación no puede ser menor a cero'); |
|
32 | } |
||
33 | 2 | $this->decimales = $decimales; |
|
34 | 2 | $this->porcentajeVariacion = $porcentajeVariacion; |
|
35 | } |
||
36 | |||
37 | 1 | public function decimales(): int |
|
40 | } |
||
41 | |||
42 | 1 | public function porcentajeVariacion(): int |
|
47 |