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
ItemReward 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
3declare(strict_types=1);
4
5namespace Lorekeeper\Core\World\Quest\Reward;
6
7use Lorekeeper\Core\Item\ItemId;
8use Psl\Type;
9
10final readonly class ItemReward implements QuestReward
11{
12    /** @var positive-int */
13    public int $quantity;
14
15    public function __construct(
16        public ItemId $itemId,
17        public DropRate $dropRate,
18        int $quantity,
19        public ItemRewardType $type,
20    ) {
21        $this->quantity = Type\positive_int()->assert($quantity);
22    }
23}