public static function getCheckDigit(string $number) : int
    {
        if (! ctype_digit($number)) {
            throw new \InvalidArgumentException('The number must be a string of digits');
        }

        $checksum = self::checksum($number . '0');

        return ($checksum === 0) ? 0 : 10 - $checksum;
    }
public static function getCheckDigit(string $number) : int
    {
        if (! ctype_digit($number)) {
            throw new \InvalidArgumentException('The number must be a string of digits');
        }

        $checksum = self::checksum($number . '0');

        return ($checksum === 0) ? 0 : 10 - $checksum;
    }
public static function getCheckDigit ( string $ number ) : int { if ( ! ctype_digit ( $ number ) ) { throw new \ InvalidArgumentException ( 'The number must be a string of digits' ) ; } $ checksum = self :: checksum ( $ number . '0' ) ; return ( $ checksum === 0 ) ? 0 : 10 - $ checksum ; }
Computes and returns the check digit of a number.

@param string $number

@return int

@throws \InvalidArgumentException
Computes and returns the check digit of a number .