| @@ 24-41 (lines=18) @@ | ||
| 21 | * |
|
| 22 | * @author Bernhard Schussek <[email protected]> |
|
| 23 | */ |
|
| 24 | class DuplicateAssetMappingException extends Exception |
|
| 25 | { |
|
| 26 | /** |
|
| 27 | * Creates an exception for a UUID that exists already. |
|
| 28 | * |
|
| 29 | * @param Uuid $uuid The UUID of the mapping. |
|
| 30 | * @param Exception|null $cause The exception that caused this exception. |
|
| 31 | * |
|
| 32 | * @return static The created exception. |
|
| 33 | */ |
|
| 34 | public static function forUuid(Uuid $uuid, Exception $cause = null) |
|
| 35 | { |
|
| 36 | return new static(sprintf( |
|
| 37 | 'The asset mapping "%s" exists already.', |
|
| 38 | $uuid->toString() |
|
| 39 | ), 0, $cause); |
|
| 40 | } |
|
| 41 | } |
|
| 42 | ||
| @@ 24-41 (lines=18) @@ | ||
| 21 | * |
|
| 22 | * @author Bernhard Schussek <[email protected]> |
|
| 23 | */ |
|
| 24 | class NoSuchAssetMappingException extends Exception |
|
| 25 | { |
|
| 26 | /** |
|
| 27 | * Creates an exception for a UUID that was not found. |
|
| 28 | * |
|
| 29 | * @param Uuid $uuid The UUID of the mapping. |
|
| 30 | * @param Exception|null $cause The exception that caused this exception. |
|
| 31 | * |
|
| 32 | * @return static The created exception. |
|
| 33 | */ |
|
| 34 | public static function forUuid(Uuid $uuid, Exception $cause = null) |
|
| 35 | { |
|
| 36 | return new static(sprintf( |
|
| 37 | 'The asset mapping "%s" does not exist.', |
|
| 38 | $uuid->toString() |
|
| 39 | ), 0, $cause); |
|
| 40 | } |
|
| 41 | } |
|
| 42 | ||
| @@ 25-42 (lines=18) @@ | ||
| 22 | * |
|
| 23 | * @author Bernhard Schussek <[email protected]> |
|
| 24 | */ |
|
| 25 | class DuplicateBindingException extends RuntimeException |
|
| 26 | { |
|
| 27 | /** |
|
| 28 | * Creates an exception for a duplicate UUID. |
|
| 29 | * |
|
| 30 | * @param Uuid $uuid The UUID. |
|
| 31 | * @param Exception|null $cause The exception that caused this exception. |
|
| 32 | * |
|
| 33 | * @return static The created exception. |
|
| 34 | */ |
|
| 35 | public static function forUuid(Uuid $uuid, Exception $cause = null) |
|
| 36 | { |
|
| 37 | return new static(sprintf( |
|
| 38 | 'A binding with UUID "%s" exists already.', |
|
| 39 | $uuid->toString() |
|
| 40 | ), 0, $cause); |
|
| 41 | } |
|
| 42 | } |
|
| 43 | ||