public static function toIsbn10($ean, $onError = null)
    {
        // Sanitize
        $ean = preg_replace('/[^0-9]/', '', $ean);

        // Validate
        if (!preg_match('/^978(\d{9})\d?$/', $ean, $found)) {
            return $onError;
        }

        // Convert
        $isbn = $found[1];
        $isbn = static::withCheckDigitForIsbn10($isbn);

        return $isbn ?: $onError;
    }