| Conditions | 2 |
| Paths | 2 |
| Total Lines | 12 |
| Code Lines | 8 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 9 |
| CRAP Score | 2 |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php declare(strict_types = 1); |
||
| 20 | 4 | public function __construct(string $name, int $quantity, int $amount, ?string $description = null) |
|
| 21 | { |
||
| 22 | 4 | Validator::checkCartItemName($name); |
|
| 23 | 4 | if ($description !== null) { |
|
| 24 | 3 | Validator::checkCartItemDescription($description); |
|
| 25 | } |
||
| 26 | 4 | Validator::checkCartItemQuantity($quantity); |
|
| 27 | |||
| 28 | 3 | $this->name = $name; |
|
| 29 | 3 | $this->quantity = $quantity; |
|
| 30 | 3 | $this->amount = $amount; |
|
| 31 | 3 | $this->description = $description; |
|
| 32 | 3 | } |
|
| 55 |