private function buildDigitList($digitList)
    {
        if (is_int($digitList)) {
            return new IntegerDigitList($digitList);
        } elseif (is_string($digitList)) {
            return new StringDigitList($digitList);
        } elseif (is_array($digitList)) {
            return new ArrayDigitList($digitList);
        }

        throw new \InvalidArgumentException('Unexpected number base type');
    }