Lines
100.00%
7 / 7
Methods
100.00%
2 / 2
Classes
100.00%
1 / 1
| Name | Lines | Methods | CRAP | ||||
|---|---|---|---|---|---|---|---|
| __construct | 100.00% | 1 / 1 | 100.00% | 1 / 1 | 1 | ||
| update | 100.00% | 6 / 6 | 100.00% | 1 / 1 | 7 | ||
| 7 | final class PrimaryAttributes | |
| 8 | { | |
| 9 | /** @mago-expect lint:excessive-parameter-list */ | |
| 10 | public function __construct( | |
| 11 | public private(set) Strength $strength = new Strength(0), | |
| 12 | public private(set) Intellect $intellect = new Intellect(0), | |
| 13 | public private(set) Dexterity $dexterity = new Dexterity(0), | |
| 14 | public private(set) Endurance $endurance = new Endurance(0), | |
| 15 | public private(set) Wisdom $wisdom = new Wisdom(0), | |
| 16 | public private(set) Luck $luck = new Luck(0), | |
| 17 | ) {} | |
| 18 | ||
| 19 | /** @mago-expect analysis:match-not-exhaustive */ | |
| 20 | public function update(PrimaryAttribute $stat): void | |
| 21 | { | |
| 22 | match (true) { | |
| 23 | $stat instanceof Strength => $this->strength = $stat, | |
| 24 | $stat instanceof Intellect => $this->intellect = $stat, | |
| 25 | $stat instanceof Dexterity => $this->dexterity = $stat, | |
| 26 | $stat instanceof Endurance => $this->endurance = $stat, | |
| 27 | $stat instanceof Wisdom => $this->wisdom = $stat, | |
| 28 | $stat instanceof Luck => $this->luck = $stat, | |
| 29 | }; | |
| 30 | } | |
| 31 | } |