Total Complexity | 3 |
Total Lines | 36 |
Duplicated Lines | 0 % |
Changes | 0 |
1 | <?php |
||
17 | class AddressDoesNotExist extends InvalidArgumentException |
||
18 | { |
||
19 | /** |
||
20 | * Creates an exception with an error message based on the address name. |
||
21 | * |
||
22 | * @param string $addressName the address name |
||
23 | * |
||
24 | * @return static |
||
25 | */ |
||
26 | public static function create(string $addressName) |
||
29 | } |
||
30 | |||
31 | /** |
||
32 | * Creates an exception with an error message based on the address ID. |
||
33 | * |
||
34 | * @param int $addressId the address ID which does not exist in the database |
||
35 | * |
||
36 | * @return static |
||
37 | */ |
||
38 | public static function withId(int $addressId) |
||
39 | { |
||
40 | return new static("There is no [address] with id `{$addressId}`."); |
||
41 | } |
||
42 | |||
43 | /** |
||
44 | * Creates an exception with an error message based on the address type name. |
||
45 | * |
||
46 | * @param string $addressType The address type name which does not exist in the database |
||
47 | * |
||
48 | * @return static |
||
49 | */ |
||
50 | public static function withType(string $addressType) |
||
53 | } |
||
54 | } |
||
55 |