private function sanitizePrecision($precision)
    {
        if (!is_numeric($precision) || $precision < 0) {
            throw new \InvalidArgumentException(sprintf('Invalid precision: %s', print_r($precision, true)));
        }

        return (int) $precision;
    }