public function setDigits($digits)
    {
        $digits = abs(intval($digits));
        if ($digits < 1 || $digits > 10) {
            throw new \InvalidArgumentException('Digits must be a number between 1 and 10 inclusive');
        }
        $this->digits = $digits;

        return $this;
    }
public function setDigits($digits)
    {
        $digits = abs(intval($digits));
        if ($digits < 1 || $digits > 10) {
            throw new \InvalidArgumentException('Digits must be a number between 1 and 10 inclusive');
        }
        $this->digits = $digits;

        return $this;
    }
public function setDigits ( $ digits ) { $ digits = abs ( intval ( $ digits ) ) ; if ( $ digits < 1 || $ digits > 10 ) { throw new \ InvalidArgumentException ( 'Digits must be a number between 1 and 10 inclusive' ) ; } $ this -> digits = $ digits ; return $ this ; }
Set the number of digits in the one-time password

@param  integer $digits The number of digits.
@return self    Returns an instance of self for method chaining.
@throws \InvalidArgumentException Thrown if the requested number of
digits is outside of the inclusive range 1-10.
Set the number of digits in the one - time password