Code Coverage |
||||||||||
Lines |
Functions and Methods |
Classes and Traits |
||||||||
| Total | |
100.00% |
2 / 2 |
|
100.00% |
1 / 1 |
CRAP | |
100.00% |
1 / 1 |
| CommentNotFoundException | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |
100.00% |
1 / 1 |
| forId | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |||
| 1 | <?php |
| 2 | |
| 3 | declare(strict_types=1); |
| 4 | |
| 5 | /** @license For full copyright and license information, please see the LICENSE.md file. */ |
| 6 | |
| 7 | namespace App\Modules\Comments\Domain\Exception; |
| 8 | |
| 9 | defined('AMMONLY_APP') || exit('Direct script access is forbidden.'); |
| 10 | |
| 11 | use DomainException; |
| 12 | |
| 13 | /** |
| 14 | * Exception thrown when a requested comment cannot be found. |
| 15 | * |
| 16 | * @package App\Modules\Comments\Domain\Exception |
| 17 | */ |
| 18 | final class CommentNotFoundException extends DomainException |
| 19 | { |
| 20 | public static function forId(int $id): self |
| 21 | { |
| 22 | return new self(sprintf('Comment with ID %d was not found.', $id)); |
| 23 | } |
| 24 | } |