Code Coverage |
||||||||||
Lines |
Functions and Methods |
Classes and Traits |
||||||||
| Total | |
100.00% |
2 / 2 |
|
100.00% |
2 / 2 |
CRAP | |
100.00% |
1 / 1 |
| GroupOlxMappingException | |
100.00% |
2 / 2 |
|
100.00% |
2 / 2 |
3 | |
100.00% |
1 / 1 |
| __construct | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
2 | |||
| withErrors | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |||
| 1 | <?php |
| 2 | |
| 3 | declare(strict_types=1); |
| 4 | |
| 5 | namespace ImovelZapAi\Publishing\Connectors\GroupOlx\Domain\Exceptions; |
| 6 | |
| 7 | use RuntimeException; |
| 8 | |
| 9 | final class GroupOlxMappingException extends RuntimeException |
| 10 | { |
| 11 | /** @param list<string> $errors */ |
| 12 | public function __construct( |
| 13 | public readonly array $errors, |
| 14 | string $message = 'Falha ao mapear imóvel para VRSync (Grupo OLX).', |
| 15 | ) { |
| 16 | parent::__construct($message.($errors !== [] ? ' '.implode(' ', $errors) : '')); |
| 17 | } |
| 18 | |
| 19 | /** @param list<string> $errors */ |
| 20 | public static function withErrors(array $errors): self |
| 21 | { |
| 22 | return new self($errors); |
| 23 | } |
| 24 | } |