Code Coverage
 
Lines
Functions and Methods
Classes and Traits
Total
100.00% covered (success)
100.00%
1 / 1
100.00% covered (success)
100.00%
1 / 1
CRAP
100.00% covered (success)
100.00%
1 / 1
MemberNotFound
100.00% covered (success)
100.00%
1 / 1
100.00% covered (success)
100.00%
1 / 1
1
100.00% covered (success)
100.00%
1 / 1
 withId
100.00% covered (success)
100.00%
1 / 1
100.00% covered (success)
100.00%
1 / 1
1
1<?php
2
3declare(strict_types=1);
4
5namespace App\Trip\Domain\Exceptions;
6
7use App\Trip\Domain\ValueObject\MemberId;
8use 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 */
14final 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}