private function validateDigits(& $digits)
    {
        ksort($digits);

        if (count($digits) < 2) {
            throw new \InvalidArgumentException('Number base must have at least 2 digits');
        } elseif (array_keys($digits) !== range(0, count($digits) - 1)) {
            throw new \InvalidArgumentException('Invalid digit values in the number base');
        } elseif ($this->detectDuplicates($digits)) {
            throw new \InvalidArgumentException('Number base cannot have duplicate digits');
        }
    }
private function validateDigits(& $digits)
    {
        ksort($digits);

        if (count($digits) < 2) {
            throw new \InvalidArgumentException('Number base must have at least 2 digits');
        } elseif (array_keys($digits) !== range(0, count($digits) - 1)) {
            throw new \InvalidArgumentException('Invalid digit values in the number base');
        } elseif ($this->detectDuplicates($digits)) {
            throw new \InvalidArgumentException('Number base cannot have duplicate digits');
        }
    }
private function validateDigits ( & $ digits ) { ksort ( $ digits ) ; if ( count ( $ digits ) < 2 ) { throw new \ InvalidArgumentException ( 'Number base must have at least 2 digits' ) ; } elseif ( array_keys ( $ digits ) !== range ( 0 , count ( $ digits ) - 1 ) ) { throw new \ InvalidArgumentException ( 'Invalid digit values in the number base' ) ; } elseif ( $ this -> detectDuplicates ( $ digits ) ) { throw new \ InvalidArgumentException ( 'Number base cannot have duplicate digits' ) ; } }
Validates and sorts the list of digits.
@param array $digits The list of digits for the numeral system
@throws \InvalidArgumentException If the digit list is invalid
Validates and sorts the list of digits .