Lines
100.00%
2 / 2
Functions and Methods
100.00%
2 / 2
Classes and Traits
100.00%
1 / 1
| Name | Lines | Functions and Methods | CRAP | Classes and Traits | ||||||
|---|---|---|---|---|---|---|---|---|---|---|
| QuestGroupId | 100.00% | 2 / 2 | 100.00% | 2 / 2 | 4 | 100.00% | 1 / 1 | |||
| __construct | 100.00% | 1 / 1 | 100.00% | 1 / 1 | 1 | |||||
| equals | 100.00% | 1 / 1 | 100.00% | 1 / 1 | 3 | |||||
| 1 | <?php | |
| 2 | ||
| 3 | declare(strict_types=1); | |
| 4 | ||
| 5 | namespace Lorekeeper\Core\World\Quest; | |
| 6 | ||
| 7 | use Psl\Comparison\Equable; | |
| 8 | ||
| 9 | /** | |
| 10 | * @implements Equable<QuestGroupId> | |
| 11 | */ | |
| 12 | final readonly class QuestGroupId implements Equable | |
| 13 | { | |
| 14 | public function __construct( | |
| 15 | public QuestGroup $group, | |
| 16 | public QuestGroupNumber $number, | |
| 17 | ) {} | |
| 18 | ||
| 19 | /** | |
| 20 | * @param QuestGroupId $other | |
| 21 | * | |
| 22 | * @mago-expect analysis:redundant-logical-operation | |
| 23 | */ | |
| 24 | public function equals(mixed $other): bool | |
| 25 | { | |
| 26 | return $other instanceof self && $other->group === $this->group && $other->number->equals($this->number); | |
| 27 | } | |
| 28 | } |