Code Coverage |
||||||||||
Lines |
Functions and Methods |
Classes and Traits |
||||||||
| Total | |
100.00% |
2 / 2 |
|
100.00% |
1 / 1 |
CRAP | |
100.00% |
1 / 1 |
| DocumentNotFoundException | |
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\Documents\Domain\Exception; |
| 8 | |
| 9 | defined('AMMONLY_APP') || exit('Direct script access is forbidden.'); |
| 10 | |
| 11 | use RuntimeException; |
| 12 | |
| 13 | /** |
| 14 | * Exception thrown when a requested document cannot be located. |
| 15 | * |
| 16 | * @package App\Modules\Documents\Domain\Exception |
| 17 | */ |
| 18 | final class DocumentNotFoundException extends RuntimeException |
| 19 | { |
| 20 | /** |
| 21 | * Creates exception for missing document ID. |
| 22 | * |
| 23 | * @param int $documentId Identifier of the missing document. |
| 24 | * @return self New instance. |
| 25 | */ |
| 26 | public static function forId(int $documentId): self |
| 27 | { |
| 28 | return new self("Document with ID {$documentId} was not found."); |
| 29 | } |
| 30 | } |