public static function encode($value, $options = 0)
    {
        $result = json_encode($value, (int) $options);
        // @codeCoverageIgnoreStart
        if ($result === false) {
            throw new \RuntimeException(static::$errorMessages[json_last_error()]);
        }
        // @codeCoverageIgnoreEnd

        return $result;
    }