Total Complexity | 11 |
Total Lines | 44 |
Duplicated Lines | 0 % |
Coverage | 100% |
Changes | 0 |
1 | <?php |
||
9 | trait EntryWithVigenciasTrait |
||
10 | { |
||
11 | /** @var int */ |
||
12 | private $vigenteDesde; |
||
13 | |||
14 | /** @var int */ |
||
15 | private $vigenteHasta; |
||
16 | |||
17 | 297 | protected function setUpVigencias(int $vigenteDesde, int $vigenteHasta): void |
|
18 | { |
||
19 | 297 | if ($vigenteDesde < 0) { |
|
20 | 2 | throw new SatCatalogosLogicException('El campo vigente desde no puede ser menor a cero'); |
|
21 | } |
||
22 | 295 | if ($vigenteHasta < 0) { |
|
23 | 2 | throw new SatCatalogosLogicException('El campo vigente hasta no puede ser menor a cero'); |
|
24 | } |
||
25 | 293 | $this->vigenteDesde = $vigenteDesde; |
|
26 | 293 | $this->vigenteHasta = $vigenteHasta; |
|
27 | } |
||
28 | |||
29 | 84 | public function vigenteDesde(): int |
|
32 | } |
||
33 | |||
34 | 84 | public function vigenteHasta(): int |
|
35 | { |
||
36 | 84 | return $this->vigenteHasta; |
|
37 | } |
||
38 | |||
39 | 4 | public function vigenteEn(int $timestamp): bool |
|
48 | } |
||
49 | |||
50 | 1 | public function vigenteAhora(): bool |
|
53 | } |
||
54 | } |
||
55 |