public function generate(&$result,GeneratorInterface $generator)
    {
        if($this->literals->count() === 0) {
            throw new GeneratorException('There are no literals to choose from');
        }
        
       $repeat_x = $this->calculateRepeatQuota($generator);
        
        while($repeat_x > 0) {
             $randomIndex = 0;
             
             if($this->literals->count() > 1) {
                $randomIndex = \round($generator->generate(1,($this->literals->count())));        
             }
             
             $result     .= $this->literals->getAt($randomIndex);
             
             --$repeat_x;
        }
        
        return $result;
        
    }
public function generate(&$result,GeneratorInterface $generator)
    {
        if($this->literals->count() === 0) {
            throw new GeneratorException('There are no literals to choose from');
        }
        
       $repeat_x = $this->calculateRepeatQuota($generator);
        
        while($repeat_x > 0) {
             $randomIndex = 0;
             
             if($this->literals->count() > 1) {
                $randomIndex = \round($generator->generate(1,($this->literals->count())));        
             }
             
             $result     .= $this->literals->getAt($randomIndex);
             
             --$repeat_x;
        }
        
        return $result;
        
    }
public function generate ( & $ result , GeneratorInterface $ generator ) { if ( $ this -> literals -> count ( ) === 0 ) { throw new GeneratorException ( 'There are no literals to choose from' ) ; } $ repeat_x = $ this -> calculateRepeatQuota ( $ generator ) ; while ( $ repeat_x > 0 ) { $ randomIndex = 0 ; if ( $ this -> literals -> count ( ) > 1 ) { $ randomIndex = \ round ( $ generator -> generate ( 1 , ( $ this -> literals -> count ( ) ) ) ) ; } $ result .= $ this -> literals -> getAt ( $ randomIndex ) ; -- $ repeat_x ; } return $ result ; }
Generate a text string appending to the result argument

@access public
@param string $result
@param GeneratorInterface $generator
Generate a text string appending to the result argument