Code Coverage
 
Lines
Functions and Methods
Classes and Traits
Total
100.00% covered (success)
100.00%
5 / 5
100.00% covered (success)
100.00%
5 / 5
CRAP
100.00% covered (success)
100.00%
1 / 1
SignatureException
100.00% covered (success)
100.00%
5 / 5
100.00% covered (success)
100.00%
5 / 5
5
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
 tokenInvalid
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
 providerUnavailable
100.00% covered (success)
100.00%
1 / 1
100.00% covered (success)
100.00%
1 / 1
1
 otpInvalid
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\Signatures\Domain\Exceptions;
6
7use RuntimeException;
8
9class SignatureException extends RuntimeException
10{
11    public static function invalidState(string $detail): self
12    {
13        return new self("Operação inválida na assinatura: {$detail}");
14    }
15
16    public static function tokenInvalid(): self
17    {
18        return new self('Link de assinatura inválido ou expirado.');
19    }
20
21    public static function notFound(): self
22    {
23        return new self('Solicitação de assinatura não encontrada.');
24    }
25
26    public static function providerUnavailable(?string $detail = null): self
27    {
28        return new self($detail ?? 'Provedor de assinatura indisponível ou não configurado.');
29    }
30
31    public static function otpInvalid(): self
32    {
33        return new self('Código de verificação inválido ou expirado.');
34    }
35}