protected function throwInitError($code, $function)
    {
        switch ($code) {
            case -4:
                throw new \RuntimeException(sprintf(
                    'There was a memory allocation problem while calling %s::%s',
                    __CLASS__,
                    $function
                ));
                break;
            case -3:
                throw new \RuntimeException(sprintf(
                    'An incorrect encryption key length was used while calling %s::%s',
                    __CLASS__,
                    $function
                ));
                break;
            default:
                if (is_integer($code) && $code < 0) {
                    throw new \RuntimeException(sprintf(
                        'An unknown error was caught while calling %s::%s',
                        __CLASS__,
                        $function
                    ));
                }
                break;
        }
    }
protected function throwInitError($code, $function)
    {
        switch ($code) {
            case -4:
                throw new \RuntimeException(sprintf(
                    'There was a memory allocation problem while calling %s::%s',
                    __CLASS__,
                    $function
                ));
                break;
            case -3:
                throw new \RuntimeException(sprintf(
                    'An incorrect encryption key length was used while calling %s::%s',
                    __CLASS__,
                    $function
                ));
                break;
            default:
                if (is_integer($code) && $code < 0) {
                    throw new \RuntimeException(sprintf(
                        'An unknown error was caught while calling %s::%s',
                        __CLASS__,
                        $function
                    ));
                }
                break;
        }
    }
protected function throwInitError ( $ code , $ function ) { switch ( $ code ) { case - 4 : throw new \ RuntimeException ( sprintf ( 'There was a memory allocation problem while calling %s::%s' , __CLASS__ , $ function ) ) ; break ; case - 3 : throw new \ RuntimeException ( sprintf ( 'An incorrect encryption key length was used while calling %s::%s' , __CLASS__ , $ function ) ) ; break ; default : if ( is_integer ( $ code ) && $ code < 0 ) { throw new \ RuntimeException ( sprintf ( 'An unknown error was caught while calling %s::%s' , __CLASS__ , $ function ) ) ; } break ; } }
Throw an exception based on a provided exit code
@param  mixed  $code
@param  string $function
@throws \RuntimeException If there was a memory allocation problem
@throws \RuntimeException If there was an incorrect key length specified
@throws \RuntimeException If an unknown error occured
Throw an exception based on a provided exit code