Code Coverage |
||||||||||
Lines |
Functions and Methods |
Classes and Traits |
||||||||
| Total | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
CRAP | |
100.00% |
1 / 1 |
| MemberNotFound | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |
100.00% |
1 / 1 |
| withId | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |||
| 1 | <?php |
| 2 | |
| 3 | declare(strict_types=1); |
| 4 | |
| 5 | namespace App\Trip\Domain\Exceptions; |
| 6 | |
| 7 | use App\Trip\Domain\ValueObject\MemberId; |
| 8 | use DomainException; |
| 9 | |
| 10 | /** |
| 11 | * No editor/viewer membership row for this user on the trip. Maps to 404 (the |
| 12 | * owner is not a member row, so trying to remove the owner lands here too). |
| 13 | */ |
| 14 | final class MemberNotFound extends DomainException |
| 15 | { |
| 16 | public static function withId(MemberId $userId): self |
| 17 | { |
| 18 | return new self(sprintf('User <%s> is not a member of this trip.', $userId->value())); |
| 19 | } |
| 20 | } |