Lines
100.00%
3 / 3
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% | 2 / 2 | 100.00% | 1 / 1 | 3 | ||
| 7 | final class Powers | |
| 8 | { | |
| 9 | public function __construct( | |
| 10 | public private(set) AttackPower $attack = new AttackPower(0), | |
| 11 | public private(set) SpellPower $spell = new SpellPower(0), | |
| 12 | ) {} | |
| 13 | ||
| 14 | /** @mago-expect analysis:match-not-exhaustive */ | |
| 15 | public function update(Power $stat): void | |
| 16 | { | |
| 17 | match (true) { | |
| 18 | $stat instanceof AttackPower => $this->attack = $stat, | |
| 19 | $stat instanceof SpellPower => $this->spell = $stat, | |
| 20 | }; | |
| 21 | } | |
| 22 | } |