private function zeroTrim(array $number, $right)
    {
        $zero = $this->target->getDigit(0);

        while (($right ? end($number) : reset($number)) === $zero) {
            unset($number[key($number)]);
        }

        return empty($number) ? [$zero] : array_values($number);
    }
private function zeroTrim(array $number, $right)
    {
        $zero = $this->target->getDigit(0);

        while (($right ? end($number) : reset($number)) === $zero) {
            unset($number[key($number)]);
        }

        return empty($number) ? [$zero] : array_values($number);
    }
private function zeroTrim ( array $ number , $ right ) { $ zero = $ this -> target -> getDigit ( 0 ) ; while ( ( $ right ? end ( $ number ) : reset ( $ number ) ) === $ zero ) { unset ( $ number [ key ( $ number ) ] ) ; } return empty ( $ number ) ? [ $ zero ] : array_values ( $ number ) ; }
Trims extraneous zeroes from the digit list.
@param array $number Array of digits to trim
@param bool $right True to trim from right, false to trim from left
@return array Trimmed array of digits
Trims extraneous zeroes from the digit list .