/* (non-PHPdoc)
@see \Fminor\Core\Generator\GeneratorAbstract::generate()
438373
public function generate(array $requests, ParametersManager $parManager)
    {
        $twig = new TwigEngine(__DIR__);
        $param = array('routes' => RoutingRequest::filter($requests));
        $this->create('src/Config/', 'routes.php', $twig->render('routes.php.twig', $param));
    }
138955
public function getGenerator(): \Generator
    {
        if ($this->generator instanceof ArrayyRewindableGenerator) {
            yield from $this->generator;
        }

        yield from $this->array;
    }
666638
public function generate()
    {
        $output = $this->generateIdeHelperOutput();
        $this->writeIdeHelperFile($output, '.ide-helper.php');

        $outputForPhpStormIde = $this->generatePhpStormIdeHelperOutput();
        $this->writeIdeHelperFile($outputForPhpStormIde, '.phpstorm.meta.php/oxid.meta.php');
    }
447568
public function generate()
    {
        $code = array();

        $body = $this->getExtraBody();
        $bodyHasOpenTag = preg_match('#(?:\s*)<\?php#', $body);
        $code[] = '<?php';
        $code[] = null;

        // Documentation.
        $doc = $this->generateDocumentation();
        if ($doc !== null) {
            $code[] = $doc;
            $code[] = null;
        }

        foreach ($this->objects as $object) {
            foreach ($object->getUses() as $use => $alias) {
                $this->addUse($use, $alias);
            }
        }

        // If there are objects in different namespaces or some objects are in a different namespace compared to the file namespace.
        if ($this->areMultipleNamespacesInFile() === true) {
            $code = array_merge($code, $this->renderObjects(true));

            $code[] = $this->getIndentation() . 'namespace ' . $this->namespace;
            $code[] = '{';
            $code[] = null;

            // Temporarily add one more level of indentation.
            $this->addIndentationLevel(1);

            $code = array_merge($code, $this->renderRequiredFilesLines());

            $code = array_merge($code, $this->renderUsesLines());

            if ($bodyHasOpenTag > 0) {
                $code[] = '?>';
            }

            if ($this->extraBody !== null) {
                $code[] = $this->extraBody;
            }

            // Set back the indentation.
            $this->addIndentationLevel(-1);

            $code[] = $this->getIndentation() . '}';
        } else {
            if ($this->namespace !== null) {
                $code[] = $this->getIndentation() . 'namespace ' . $this->namespace . ';';
                $code[] = null;
            }

            $code = array_merge($code, $this->renderRequiredFilesLines());

            $code = array_merge($code, $this->renderUsesLines());

            $code = array_merge($code, $this->renderObjects(false));

            if ($bodyHasOpenTag > 0) {
                $code[] = '?>';
            }

            if ($this->extraBody !== null) {
                $code[] = $this->extraBody;
            }
        }

        return implode($this->getLineFeed(), $code);
    }
29765
private function generateProperties(): EntityGenerator
    {
        $this->entityClass
            ->addProperty('id')
            ->setVisibility('private')
            ->addComment($this->entityData['class'] . ' ID' . PHP_EOL)
            ->addComment('@var int $id');

        foreach ($this->entityData['properties'] as $name => $type) {
            if ('datetime' === $type) {
                $type = '\DateTime';
            }

            $this->entityClass
                ->addProperty($name)
                ->setVisibility('private')
                ->addComment($this->entityData['class'] . ' ' . $name . PHP_EOL)
                ->addComment('@var ' . $type . ' $' . $name);
        }

        return $this;
    }
465804
protected function generate()
    {
        if ($this->subperiodsProcessed) {
            return;
        }

        parent::generate();
        $date = $this->date;

        if ($date->toString('N') > 1) {
            $date = $date->subDay($date->toString('N') - 1);
        }

        $startWeek = $date;

        $currentDay = clone $startWeek;
        while ($currentDay->compareWeek($startWeek) == 0) {
            $this->addSubperiod(new Day($currentDay));
            $currentDay = $currentDay->addDay(1);
        }
    }
159500
public function generate()
    {
        $output = [];

        $fields = array_keys(get_object_vars($this));

        foreach ($fields as $field) {
            if (($value = $this->generateValue($this->$field)) !== null) {
                $output[$field] = $value;
            }
        }

        return $output;
    }
15974
public function generate($table)
    {
        $this->checkTable($table);

        $config = $this->Table->behaviors()->Proffer->config();

        foreach ($config as $field => $settings) {
            $records = $this->{$this->Table->alias()}->find()
                ->select([$this->Table->primaryKey(), $field, $settings['dir']])
                ->where([
                    "$field IS NOT NULL",
                    "$field != ''"
                ]);

            foreach ($records as $item) {
                if ($this->param('verbose')) {
                    $this->out(
                        __('Processing ' . $this->Table->alias() . ' ' . $item->get($this->Table->primaryKey()))
                    );
                }

                if (!empty($this->param('path-class'))) {
                    $class = (string)$this->param('path-class');
                    $path = new $class($this->Table, $item, $field, $settings);
                } else {
                    $path = new ProfferPath($this->Table, $item, $field, $settings);
                }

                if (!empty($this->param('image-class'))) {
                    $class = (string)$this->param('image-class');
                    $transform = new $class($this->Table, $path);
                } else {
                    $transform = new ImageTransform($this->Table, $path);
                }

                $transform->processThumbnails($settings);

                if ($this->param('verbose')) {
                    $this->out(__('Thumbnails regenerated for ' . $path->fullPath()));
                } else {
                    $this->out(__('Thumbnails regenerated for ' . $this->Table->alias() . ' ' . $item->get($field)));
                }
            }
        }

        $this->out($this->nl(0));
        $this->out(__('<info>Completed</info>'));
    }
536935
private function generate()
    {
        $action = $this->arg->getParameter('action');

        if (!in_array($action, ['key', 'resource', 'session'])) {
            $this->throwFailsAction('This action is not exists', 'help generate');
        }

        $this->command->call(
            'generate',
            $action,
            $this->arg->getParameter('target')
        );
    }
148456
public static function generate()
    {
        if (version_compare(PHP_VERSION, '7.0.0', '<')) {
            return sprintf('%04x%04x-%04x-%04x-%04x-%04x%04x%04x',
                mt_rand(0, 0xffff), mt_rand(0, 0xffff), mt_rand(0, 0xffff),
                mt_rand(0, 0x0fff) | 0x4000,
                mt_rand(0, 0x3fff) | 0x8000,
                mt_rand(0, 0xffff), mt_rand(0, 0xffff), mt_rand(0, 0xffff)
            );
        } else {
            $uuid = bin2hex(random_bytes(18));
            $uuid[8] = $uuid[13] = $uuid[18] = $uuid[23] = '-';
            $uuid[14] = '4';

            return $uuid;
        }
    }
223651
protected function generate(FileGenerator $generator)
    {
        $fqcn = $this->convertToFullQualifyClassName($this->getNameInput());

        $path = $this->getRelativePath($fqcn).'.php';

        if ($generator->exists($path)) {
            $this->error($this->type.' already exists!');

            return false;
        }

        return $this->generateFile($generator, $path, $fqcn);
    }
1331217
public function generate($validator)
    {
        $generator = new Generator(
            $this->setting->getValidationDirectory(),
            $validator
        );

        if ($generator->fileExists()) {
            echo Color::red('The validator already exists.');

            exit(0);
        }

        $generator->write('validator', [
            'baseNamespace' => $this->namespaces['validation']
        ]);

        echo Color::green('The validator was created well.');

        exit(0);
    }
835016
public function generate()
    {
        return sprintf(
            '<%s %s>%s</%s>%s',
            $this->tag,
            parent::generate(),
            $this->label,
            $this->tag,
            PHP_EOL
        );
    }
889096
public function fetchAllGenerator(): Generator
    {
        if (!$this->wasExecuted()) {
            $this->exec();
        }

        $statement = $this->getAdapter()->getStatement();

        while ($record = $statement->fetch(PDO::FETCH_ASSOC)) {
            yield $record;
        }

        $statement->closeCursor();
    }
602099
public function generate() {
		$codeCompletionGenerator = $this->getGenerator();

		if ($this->param('dry-run')) {
			return static::CODE_SUCCESS;
		}

		$types = $codeCompletionGenerator->generate();

		$this->out('CodeCompletion files generated: ' . implode(', ', $types));

		return static::CODE_SUCCESS;
	}
1314620
public function generate(Project $project)
    {
        if ($generators = $this->file->getData('generator')) {
            // Kick off the generation with the first generator. Because File generators can either mutate the current File
            // or generate an array of File's we then continue the generation with a while loop until all generators have been
            // run resulting in a flat array.
            $first = reset($generators);
            $this->mergeGenerated($project->getContentGenerator($first, $this->file)->generate($project));

            while ($this->canGenerate()) {
                foreach ($this->generatedFiles as $file) {
                    if (! $generators = $file->getData('generator')) {
                        continue;
                    }
                    $first = reset($generators);
                    $this->mergeGenerated($project->getContentGenerator($first, $file)->generate($project));
                }
            }

            return $this->generatedFiles;
        } else {
            return $this->file;
        }
    }
174464
public function generate()
	{
		if (TL_MODE === 'BE') {
			return parent::generate();
		}

		$parentKey = ($this->arrData['ptable'] ?: 'tl_article') . '__' . $this->arrData['pid'];
		if (isset($GLOBALS['TL_RS_COLUMNS'][$parentKey])) {
			if (!$GLOBALS['TL_RS_COLUMNS'][$parentKey]['active']) {
				trigger_error('Missing column stop element before column wrapper stop element ID ' . $this->id . '.', E_USER_WARNING);
			}
			unset($GLOBALS['TL_RS_COLUMNS'][$parentKey]);
		}
		else {
			trigger_error('Missing column wrapper start element before column wrapper stop element ID ' . $this->id . '.', E_USER_WARNING);
		}

		$htmlSuffix = '';

		if (!empty($GLOBALS['TL_RS_COLUMNS_STACK'][$parentKey])) {
			$GLOBALS['TL_RS_COLUMNS'][$parentKey] = array_pop($GLOBALS['TL_RS_COLUMNS_STACK'][$parentKey]);
			if ($GLOBALS['TL_RS_COLUMNS'][$parentKey]['active']) {
				$htmlSuffix .= '</div>';
			}
		}

		return parent::generate() . $htmlSuffix;
	}