generateVerifyCode() protected method

Generates a new verification code.
protected generateVerifyCode ( ) : string
return string the generated verification code
 protected function generateVerifyCode()
 {
     if ($this->isDigital) {
         if ($this->minLength > $this->maxLength) {
             $this->maxLength = $this->minLength;
         }
         if ($this->minLength < 3) {
             $this->minLength = 3;
         }
         if ($this->maxLength > 20) {
             $this->maxLength = 20;
         }
         $length = mt_rand($this->minLength, $this->maxLength);
         $code = '';
         for ($i = 0; $i < $length; $i++) {
             $code .= mt_rand(0, 9);
         }
         return $code;
     }
     return parent::generateVerifyCode();
 }
 /**
  * Generates a new verification code.
  * @return string the generated verification code
  */
 protected function generateVerifyCode()
 {
     // alphabets ?
     if (!$this->useMbChars) {
         return parent::generateVerifyCode();
     }
     $seeds = $this->getCaptchaSeeds();
     $len = mb_strlen($seeds, 'UTF-8');
     for ($code = '', $i = 0; $i < $this->getCaptchaLength(); ++$i) {
         $code .= mb_substr($seeds, mt_rand(0, $len - 1), 1, 'UTF-8');
     }
     return $code;
 }