Lines
100.00%
1 / 1
Methods
100.00%
1 / 1
Classes
100.00%
1 / 1
| Name | Lines | Methods | CRAP | ||||
|---|---|---|---|---|---|---|---|
| __construct | 100.00% | 1 / 1 | 100.00% | 1 / 1 | 2 | ||
| 17 | final readonly class InventoryItem | |
| 18 | { | |
| 19 | public Type\Category $category; | |
| 20 | ||
| 21 | /** | |
| 22 | * @param Option<ItemDescription> $description | |
| 23 | * @param Option<ItemPrice> $price | |
| 24 | * @param Option<Gamefile> $file | |
| 25 | * @param Option<Linkage> $link | |
| 26 | * @param Option<EquipmentSlot> $slot | |
| 27 | * | |
| 28 | * @mago-expect lint:excessive-parameter-list | |
| 29 | */ | |
| 30 | public function __construct( | |
| 31 | public ItemId $id, | |
| 32 | public ItemName $name, | |
| 33 | public Type\Equipment|Type\Weapon|Type\House|Type\Misc $detail, | |
| 34 | public Option $description, | |
| 35 | public Option $price, | |
| 36 | public Option $file, | |
| 37 | public Option $link, | |
| 38 | public Option $slot, | |
| 39 | public bool $memberOnly, | |
| 40 | ) { | |
| 41 | $this->category = $detail instanceof Type\Weapon ? $detail->parent()->parent() : $detail->parent(); | |
| 42 | } | |
| 43 | } |