Code Coverage |
||||||||||
Lines |
Functions and Methods |
Classes and Traits |
||||||||
| Total | |
100.00% |
2 / 2 |
|
100.00% |
2 / 2 |
CRAP | |
100.00% |
1 / 1 |
| InvalidIsbnException | |
100.00% |
2 / 2 |
|
100.00% |
2 / 2 |
2 | |
100.00% |
1 / 1 |
| whenValidationFailed | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |||
| whenChecksumIsInvalid | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |||
| 1 | <?php |
| 2 | |
| 3 | // ╔════════════════════════════════════════════════════════════╗ |
| 4 | // ║ MIT Licence (#Expat) - https://opensource.org/licenses/MIT ║ |
| 5 | // ║ Copyright 2026 Frederic Poeydomenge <dyno@phexium.com> ║ |
| 6 | // ╚════════════════════════════════════════════════════════════╝ |
| 7 | |
| 8 | declare(strict_types=1); |
| 9 | |
| 10 | namespace AppDemo\Library\Domain\Exception; |
| 11 | |
| 12 | use AppDemo\Shared\Domain\Exception\DomainException; |
| 13 | |
| 14 | final class InvalidIsbnException extends DomainException |
| 15 | { |
| 16 | public static function whenValidationFailed(string $message): self |
| 17 | { |
| 18 | return new self($message); |
| 19 | } |
| 20 | |
| 21 | public static function whenChecksumIsInvalid(): self |
| 22 | { |
| 23 | return new self('Invalid ISBN-13 checksum'); |
| 24 | } |
| 25 | } |