Lines
100.00%
1 / 1
Functions and Methods
100.00%
1 / 1
Classes and Traits
100.00%
1 / 1
| Name | Lines | Functions and Methods | CRAP | Classes and Traits | ||||||
|---|---|---|---|---|---|---|---|---|---|---|
| ItemObjective | 100.00% | 1 / 1 | 100.00% | 1 / 1 | 1 | 100.00% | 1 / 1 | |||
| __construct | 100.00% | 1 / 1 | 100.00% | 1 / 1 | 1 | |||||
| 1 | <?php | |
| 2 | ||
| 3 | declare(strict_types=1); | |
| 4 | ||
| 5 | namespace Lorekeeper\Core\World\Quest\Objective; | |
| 6 | ||
| 7 | use Lorekeeper\Core\Item\ItemId; | |
| 8 | use Psl\Type; | |
| 9 | ||
| 10 | final readonly class ItemObjective implements QuestObjective | |
| 11 | { | |
| 12 | /** @var positive-int */ | |
| 13 | public int $quantity; | |
| 14 | ||
| 15 | public function __construct( | |
| 16 | public ItemId $itemId, | |
| 17 | int $quantity, | |
| 18 | ) { | |
| 19 | $this->quantity = Type\positive_int()->assert($quantity); | |
| 20 | } | |
| 21 | } |