Code Coverage
 
Lines
Functions and Methods
Classes and Traits
Total
80.00% covered (warning)
80.00%
4 / 5
80.00% covered (warning)
80.00%
4 / 5
CRAP
0.00% covered (danger)
0.00%
0 / 1
ClientPortalException
80.00% covered (warning)
80.00%
4 / 5
80.00% covered (warning)
80.00%
4 / 5
5.20
0.00% covered (danger)
0.00%
0 / 1
 invalidState
100.00% covered (success)
100.00%
1 / 1
100.00% covered (success)
100.00%
1 / 1
1
 tokenInvalid
100.00% covered (success)
100.00%
1 / 1
100.00% covered (success)
100.00%
1 / 1
1
 tokenRevoked
100.00% covered (success)
100.00%
1 / 1
100.00% covered (success)
100.00%
1 / 1
1
 uploadRejected
100.00% covered (success)
100.00%
1 / 1
100.00% covered (success)
100.00%
1 / 1
1
 notFound
0.00% covered (danger)
0.00%
0 / 1
0.00% covered (danger)
0.00%
0 / 1
2
1<?php
2
3declare(strict_types=1);
4
5namespace ImovelZapAi\ClientPortal\Domain\Exceptions;
6
7use RuntimeException;
8
9class ClientPortalException extends RuntimeException
10{
11    public static function invalidState(string $detail): self
12    {
13        return new self("Operação inválida no portal: {$detail}");
14    }
15
16    public static function tokenInvalid(): self
17    {
18        return new self('Link inválido ou expirado.');
19    }
20
21    public static function tokenRevoked(): self
22    {
23        return new self('Este link foi revogado.');
24    }
25
26    public static function uploadRejected(string $detail): self
27    {
28        return new self("Upload recusado: {$detail}");
29    }
30
31    public static function notFound(): self
32    {
33        return new self('Portal não encontrado.');
34    }
35}