Code Coverage
 
Lines
Functions and Methods
Classes and Traits
Total
100.00% covered (success)
100.00%
4 / 4
100.00% covered (success)
100.00%
4 / 4
CRAP
100.00% covered (success)
100.00%
1 / 1
DealException
100.00% covered (success)
100.00%
4 / 4
100.00% covered (success)
100.00%
4 / 4
4
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
 stageNotFound
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
 alreadyClosed
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\Sales\Domain\Exceptions;
6
7use RuntimeException;
8
9class DealException extends RuntimeException
10{
11    public static function invalidState(string $detail): self
12    {
13        return new self("Operação inválida na oportunidade: {$detail}");
14    }
15
16    public static function stageNotFound(string $key): self
17    {
18        return new self("Estágio \"{$key}\" não encontrado no pipeline.");
19    }
20
21    public static function notFound(): self
22    {
23        return new self('Oportunidade não encontrada.');
24    }
25
26    public static function alreadyClosed(): self
27    {
28        return new self('Oportunidade já está encerrada.');
29    }
30}