public static function forReasonCode($code = 0, Exception $previous = null)
    {
        switch ($code) {
            case self::CODE_FOR_ENCRYPTION_FAILURE:
                $message = self::MESSAGE_FOR_ENCRYPTION_FAILURE;
                break;
            case self::CODE_FOR_RANDOM_DATA_GENERATION_FAILURE:
                $message = self::MESSAGE_FOR_RANDOM_DATA_GENERATION_FAILURE;
                break;
            default:
                $message = self::DEFAULT_MESSAGE;
        }

        return new static($message, $code, $previous);
    }