Code Coverage
 
Lines
Functions and Methods
Classes and Traits
Total
100.00% covered (success)
100.00%
3 / 3
100.00% covered (success)
100.00%
3 / 3
CRAP
100.00% covered (success)
100.00%
1 / 1
VisitException
100.00% covered (success)
100.00%
3 / 3
100.00% covered (success)
100.00%
3 / 3
3
100.00% covered (success)
100.00%
1 / 1
 invalidState
100.00% covered (success)
100.00%
1 / 1
100.00% covered (success)
100.00%
1 / 1
1
 scheduleConflict
100.00% covered (success)
100.00%
1 / 1
100.00% covered (success)
100.00%
1 / 1
1
 notFound
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 ImovelZapAi\Visits\Domain\Exceptions;
6
7use RuntimeException;
8
9class VisitException extends RuntimeException
10{
11    public static function invalidState(string $status, string $action): self
12    {
13        return new self("Visita no estado \"{$status}\" não permite a ação \"{$action}\".");
14    }
15
16    public static function scheduleConflict(string $detail): self
17    {
18        return new self("Conflito de agenda: {$detail}");
19    }
20
21    public static function notFound(): self
22    {
23        return new self('Visita não encontrada.');
24    }
25}