Exemplo n.º 1
0
 private function generateNatural()
 {
     self::generateDefaults();
     if ($this->min < 0) {
         throw new UnallowedLessThanZeroException();
     }
     return Rando::integer(['min' => $this->min, 'max' => $this->max]);
 }
Exemplo n.º 2
0
 private function doRandomization()
 {
     $length = !empty($this->length) ? $this->length : Rando::integer(['min' => $this->minLength, 'max' => $this->maxLength]);
     $string = '';
     while ($length > 0) {
         if (empty($this->pool)) {
             $string .= Rando::character();
         } else {
             $string .= Rando::character(['pool' => $this->pool]);
         }
         $length--;
     }
     return $string;
 }