Code Coverage
 
Lines
Functions and Methods
Classes and Traits
Total
0.00% covered (danger)
0.00%
0 / 5
0.00% covered (danger)
0.00%
0 / 5
CRAP
0.00% covered (danger)
0.00%
0 / 1
AutomationException
0.00% covered (danger)
0.00%
0 / 5
0.00% covered (danger)
0.00%
0 / 5
30
0.00% covered (danger)
0.00%
0 / 1
 notFound
0.00% covered (danger)
0.00%
0 / 1
0.00% covered (danger)
0.00%
0 / 1
2
 invalidState
0.00% covered (danger)
0.00%
0 / 1
0.00% covered (danger)
0.00%
0 / 1
2
 templateNotFound
0.00% covered (danger)
0.00%
0 / 1
0.00% covered (danger)
0.00%
0 / 1
2
 invalidTrigger
0.00% covered (danger)
0.00%
0 / 1
0.00% covered (danger)
0.00%
0 / 1
2
 loopDetected
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\Automation\Domain\Exceptions;
6
7use RuntimeException;
8
9class AutomationException extends RuntimeException
10{
11    public static function notFound(string $entity = 'Automação'): self
12    {
13        return new self("{$entity} não encontrada.");
14    }
15
16    public static function invalidState(string $detail): self
17    {
18        return new self("Operação inválida na automação: {$detail}");
19    }
20
21    public static function templateNotFound(): self
22    {
23        return new self('Modelo de automação não encontrado.');
24    }
25
26    public static function invalidTrigger(string $key): self
27    {
28        return new self("Gatilho inválido: {$key}.");
29    }
30
31    public static function loopDetected(): self
32    {
33        return new self('Execução ignorada para evitar loop de automações.');
34    }
35}