Total Complexity | 5 |
Total Lines | 34 |
Duplicated Lines | 0 % |
Coverage | 100% |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
9 | class CryptographyException extends \LogicException |
||
10 | { |
||
11 | public const DECRYPT_FAILURE_MESSAGE = 'Decrypt of payload is failure'; |
||
12 | public const ENCRYPT_FAILURE_MESSAGE = 'Encrypt of payload is failure'; |
||
13 | public const DECODE_BASE64_FAILURE_MESSAGE = 'Decode of base64 payload is failure'; |
||
14 | public const NOT_ENCRYPTED_PAYLOAD_MESSAGE = 'Payload is not encrypted'; |
||
15 | |||
16 | 3 | public static function fromThrowable(\Throwable $previous): self |
|
17 | { |
||
18 | 3 | return new self($previous->getMessage(), $previous->getCode(), $previous); |
|
19 | } |
||
20 | |||
21 | 1 | #[Pure] |
|
25 | } |
||
26 | |||
27 | 1 | #[Pure] |
|
31 | } |
||
32 | |||
33 | 1 | #[Pure] |
|
37 | } |
||
38 | |||
39 | 1 | #[Pure] |
|
45 |