Generate a text string appending to the result argument

@access public
@param string $result
@param GeneratorInterface $generator
190975
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;
        
    }
343925
public function call(string $method, $args): \Generator
    {
        $request = new Request();
        $request->id = $this->idSequence->current();
        $this->idSequence->next();
        $request->method = $method;
        $request->params = $args;

        $serializedRequest = Json::encode($this->mapper->dump($request));
        $this->pendingRequests[$request->id] = yield Recoil::strand();
        yield Recoil::execute($this->transport->send($serializedRequest));

        /** @var ResultResponse|ErrorResponse $response */
        $response = yield Recoil::suspend();

        if ($response instanceof ErrorResponse) {
            throw $response->error;
        }

        return $response->result;
    }
1157482
protected function execute(InputInterface $input, OutputInterface $output)
    {
        $output->writeln('Start generating...');
        $generated = $this->getFacade()->generateDataProvider();

        if ($output->isVerbose()) {
            foreach ($generated as $provider) {
                $output->writeln($provider . ' generated');
            }
        }
    }
918408
public function generate(FileGenerator $generator, array $data = [])
    {
        $result = (new DataBuilderManager())->validateRaw($generator->data_builder, $data);

        if (!$result->ok()) {
            return $result;
        }

        dispatch(new GenerateFile($generator, $data, $this->getAgent()));

        return $result;
    }
197078
public function run(CommandInterface $command, $result = null)
    {
        if(!$result instanceof ResponseInterface) {
            throw new \InvalidArgumentException(
                'The result needs to be an instance of GuzzleHttp\Message\ResponseInterface');
        }

        return json_decode($result->getBody()->getContents(), true);
    }
847311
public function addActionResult($action, $result)
    {
        if (is_null($action)) {
            throw new \RuntimeException(
                'Attempt to provide a result without providing an action',
                1294080509
            );
        }

        $this->results[$action] = $result;
    }
684234
public function render(OutputInterface $output, ResultCollection $results)
    {
        $output->write($this->getHeader());

        $table = new Table($output);
        $table->setHeaders(['File', 'Times Changed', 'Complexity', 'Score']);
        $table->addRows($results->toArray());
        $table->render();

        $output->write("\n");
    }
916616
protected function printFooter(\PHPUnit\Framework\TestResult $result): void
    {
        parent::printFooter($result);

        $this->writeNewLine();
        $this->write("Randomized with seed: {$this->seed}");
        $this->writeNewLine();
    }
37351
public function generate(InputInterface $input, ConsoleStyle $io, Generator $generator): void
    {
        $this->configure($input);

        $adminClassNameDetails = $generator->createClassNameDetails(
            $this->adminClassBasename,
            'Admin\\',
            'Admin'
        );

        $adminClassFullName = $adminClassNameDetails->getFullName();
        $this->generateAdmin($io, $generator, $adminClassNameDetails);

        $controllerClassFullName = '';
        if ($this->controllerClassBasename) {
            $controllerClassNameDetails = $generator->createClassNameDetails(
                $this->controllerClassBasename,
                'Controller\\',
                'Controller'
            );

            $this->generateController($input, $io, $generator, $controllerClassNameDetails);

            $controllerClassFullName = $controllerClassNameDetails->getFullName();
        }

        $this->generateService($input, $io, $adminClassFullName, $controllerClassFullName);
    }
963328
protected function generateString($generator)
    {
        $string = '';

        while (strlen($string) < $size = $this->getSize()) {
            $string .= $this->extractPattern($generator($size));
        }

        return $this->trimToExpectedSize($string, $size);
    }
448754
protected function response($result)
    {
        $response = $this->container->get(Application::RESPONSE);

        if ($result instanceof ResponseInterface)
        {
            return $result;
        }

        $response->stream()->write($result);

        return $response;
    }
1068671
public function generate(GeneratorInterface $generator)
    {
        $callback = function () use ($generator) {
            $handler = Handler::create($generator);
            $handler->generate();
        };

        return $callback();
    }
981420
protected function parseSendResponse($result, array $extra_result_data = array())
    {
        libxml_use_internal_errors(true);
        if (false === ($result = simplexml_load_string(trim($result)))) {
            throw new Exception\RuntimeException('API response isn\'t a valid XML string');
        }

        if (null !== ($error = $this->checkForError($result))) {
            throw $error;
        }

        // The message was successfully sent!
        return array_merge($this->getDefaults(), $extra_result_data, array(
            'status'    => ResultInterface::STATUS_SENT,
            'id'        => (string) $result->GUID['GUID']
        ));
    }
869025
public function calculateRepeatQuota(GeneratorInterface $generator)
    {
        $repeat_x = $this->getMinOccurances();
        
        if($this->getOccuranceRange() > 0) {
            $repeat_x = (integer) \round($generator->generate($this->getMinOccurances(),$this->getMaxOccurances()));        
        } 
        
        return $repeat_x;
    }
101136
private function evaluateParameters(ViewInterface $view, array $parameters): Generator
    {
        foreach ($parameters as $key => $value) {
            if (is_string($value) && mb_strpos($value, '@=') === 0) {
                $expressionLanguage = new ExpressionLanguage();
                $value = $expressionLanguage->evaluate(
                    mb_substr($value, 2),
                    [
                        'view' => $view,
                    ] + $view->getParameters()
                );
            }

            yield $key => $value;
        }
    }
744193
protected function showGeneratorHelp(GeneratorInterface $generator, OutputInterface $output)
    {
        $definition = new InputDefinition($generator->getDefinition());

        $output->writeln("<comment>Generator:</comment> <info>{$generator->getName()}</info>");
        $output->writeln(" {$generator->getDescription()}");
        $output->writeln("");

        $output->writeln("<comment>Usage:</comment>");
        $output->writeln(" {$this->getName()} {$generator->getName()} {$definition->getSynopsis()}");
        $output->writeln("");

        $descriptor = new DescriptorHelper();
        $descriptor->describe($output, $definition);
    }
650932
protected function formatSuccess($result)
    {
        switch ($this->outputMode) {
            case self::MODE_SINGLE:
                $result->data = array_values($this->data)[0];
                break;

            case self::MODE_MULTIPLE:
                $result->data = array_values($this->data);
                break;

            case self::MODE_OTHER:
                // do nothing for this output mode
                break;

            default:
                throw new HTTPException('Error generating output.  Cannot match output mode with data set.', 500, [
                    'code' => '894684684646846816161'
                ]);
        }

        // process included records if there's valid entries only
        if ($this->data && $this->included) {
            $result->included = array_flatten($this->included);
        }
    }