private static function checksum(string $number) : int
    {
        $number = strrev($number);
        $length = strlen($number);

        $sum = 0;

        for ($i = 0; $i < $length; $i++) {
            $value = $number[$i] * ($i % 2 + 1);
            $sum += ($value >= 10 ? $value - 9 : $value);
        }

        return $sum % 10;
    }
private static function checksum(string $number) : int
    {
        $number = strrev($number);
        $length = strlen($number);

        $sum = 0;

        for ($i = 0; $i < $length; $i++) {
            $value = $number[$i] * ($i % 2 + 1);
            $sum += ($value >= 10 ? $value - 9 : $value);
        }

        return $sum % 10;
    }
private static function checksum ( string $ number ) : int { $ number = strrev ( $ number ) ; $ length = strlen ( $ number ) ; $ sum = 0 ; for ( $ i = 0 ; $ i < $ length ; $ i ++ ) { $ value = $ number [ $ i ] * ( $ i % 2 + 1 ) ; $ sum += ( $ value >= 10 ? $ value - 9 : $ value ) ; } return $ sum % 10 ; }
Computes the checksum of a number.

@param string $number The number, validated as a string of digits.

@return int
Computes the checksum of a number .