| Conditions | 5 |
| Paths | 5 |
| Total Lines | 25 |
| Code Lines | 13 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 14 |
| CRAP Score | 5 |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 27 | 8 | public function __construct( |
|
| 28 | string $aduana, |
||
| 29 | string $patente, |
||
| 30 | int $ejercicio, |
||
| 31 | int $cantidad, |
||
| 32 | int $vigenteDesde, |
||
| 33 | int $vigenteHasta |
||
| 34 | ) { |
||
| 35 | 8 | if ('' === $aduana) { |
|
| 36 | 1 | throw new SatCatalogosLogicException('El campo aduana no puede ser una cadena de caracteres vacía'); |
|
| 37 | } |
||
| 38 | 7 | if ('' === $patente) { |
|
| 39 | 1 | throw new SatCatalogosLogicException('El campo patente no puede ser una cadena de caracteres vacía'); |
|
| 40 | } |
||
| 41 | 6 | if ($ejercicio < 0) { |
|
| 42 | 1 | throw new SatCatalogosLogicException('El campo ejercicio no puede ser menor a cero'); |
|
| 43 | } |
||
| 44 | 5 | if ($cantidad < 0) { |
|
| 45 | 1 | throw new SatCatalogosLogicException('El campo cantidad no puede ser menor a cero'); |
|
| 46 | } |
||
| 47 | 4 | $this->aduana = $aduana; |
|
| 48 | 4 | $this->patente = $patente; |
|
| 49 | 4 | $this->ejercicio = $ejercicio; |
|
| 50 | 4 | $this->cantidad = $cantidad; |
|
| 51 | 4 | $this->setUpVigencias($vigenteDesde, $vigenteHasta); |
|
| 52 | } |
||
| 74 |