Builds the class documentation
@return void
763586
private function buildDocumentation() {
        $model = new Swagger\Model();
        $model->setId($this->getClassName());
        $this->buildProperties($model);
        foreach($this->getRelatedModels() as $alias => $relatedModel) {
            $this->buildProperties($model, $alias);
        }
        $resource = new Swagger\Resource();
        $resource->setApiVersion('1.0')->setBasePath('/v1.0')->setResourcePath($this->getClassName());
        $resource->setDescription('');
        $documentation = $model . "\n" . $resource;
        $this->getObject()->setDocumentation($documentation);
    }
1339793
public function buildCode()
    {
        $code = '';

        if ($this->documentation) {
            $code .= '    /**'."\n";
            $code .= '     * '.str_replace("\n", "\n     * ", wordwrap($this->documentation, 73))."\n";
            $code .= '     */'."\n";
        }

        $code .= '    public function '.$this->name.'('.implode(', ', $this->parameters).')'."\n";
        $code .= '    {'."\n";
        $code .= '        '.str_replace("\n", "\n        ", $this->body)."\n";
        $code .= '    }';

        // Trim trailing whitespaces
        $code = preg_replace('/[ ]+$/m', '', $code);

        return $code;
    }
415582
public function build()
    {
        $this->builder->addEmbedded(
            $this->relation,
            $this->embeddable,
            $this->columnPrefix
        );
    }
499968
public function build()
    {
        foreach ($this->events as $event => $listeners) {
            foreach ($listeners as $listener) {
                $this->builder->getClassMetadata()->addEntityListener($event, $listener['class'], $listener['method']);
            }
        }
    }
846131
final public function build()
    {
        $arguments = func_get_args();
        $filename = array_shift($arguments);

        $className = $this->buildClassNameByFileName($filename);

        $ib = new InstanceBuilder();
        return $ib->build($className, $arguments);
    }
983911
public function build()
    {
        $cm = $this->builder->getClassMetadata();
        if ($this->generatedValue) {
            $cm->setIdGeneratorType(constant('Doctrine\ORM\Mapping\ClassMetadata::GENERATOR_TYPE_' . $this->generatedValue));
        }
        if ($this->version) {
            $cm->setVersionMapping($this->mapping);
        }
        $cm->mapField($this->mapping);
        if ($this->sequenceDef) {
            $cm->setSequenceGeneratorDefinition($this->sequenceDef);
        }
        return $this->builder;
    }
967757
public function build() {

        // Move all the CONTEXT_MODULE question qcats to their
        // final (newly created) module context
        $this->add_step(new restore_move_module_questions_categories('move_module_question_categories'));

        // Create all the question files now that every question is in place
        // and every category has its final contextid associated
        $this->add_step(new restore_create_question_files('create_question_files'));

        // Review all the block_position records in backup_ids in order
        // match them now that all the contexts are created populating DB
        // as needed. Only if we are restoring blocks.
        if ($this->get_setting_value('blocks')) {
            $this->add_step(new restore_review_pending_block_positions('review_block_positions'));
        }

        // Gradebook. Don't restore the gradebook unless activities are being restored.
        if ($this->get_setting_value('activities')) {
            $this->add_step(new restore_gradebook_structure_step('gradebook_step','gradebook.xml'));
            $this->add_step(new restore_grade_history_structure_step('grade_history', 'grade_history.xml'));
        }

        // Course completion.
        $this->add_step(new restore_course_completion_structure_step('course_completion', 'completion.xml'));

        // Conditionally restore course badges.
        if ($this->get_setting_value('badges')) {
            $this->add_step(new restore_badges_structure_step('course_badges', 'badges.xml'));
        }

        // Review all the legacy module_availability records in backup_ids in
        // order to match them with existing modules / grade items and convert
        // into the new system.
        $this->add_step(new restore_process_course_modules_availability('process_modules_availability'));

        // Update restored availability data to account for changes in IDs
        // during backup/restore.
        $this->add_step(new restore_update_availability('update_availability'));

        // Refresh action events conditionally.
        if ($this->get_setting_value('activities')) {
            $this->add_step(new restore_calendar_action_events('restoring_action_events'));
        }

        // Decode all the interlinks
        $this->add_step(new restore_decode_interlinks('decode_interlinks'));

        // Restore course logs (conditionally). They are restored here because we need all
        // the activities to be already restored.
        if ($this->get_setting_value('logs')) {
            // Legacy logs.
            $this->add_step(new restore_course_logs_structure_step('course_logs', 'course/logs.xml'));
            // New log stores.
            $this->add_step(new restore_course_logstores_structure_step('course_logstores', 'course/logstores.xml'));
        }

        // Review all the executed tasks having one after_restore method
        // executing it to perform some final adjustments of information
        // not available when the task was executed.
        // This step is always the last one performing modifications on restored information
        // Don't add any new step after it. Only aliases queue, cache rebuild and clean are allowed.
        $this->add_step(new restore_execute_after_restore('executing_after_restore'));

        // All files were sent to the filepool by now. We need to process
        // the aliases yet as they were not actually created but stashed for us instead.
        // We execute this step after executing_after_restore so that there can't be no
        // more files sent to the filepool after this.
        $this->add_step(new restore_process_file_aliases_queue('process_file_aliases_queue'));

        // Rebuild course cache to see results, whoah!
        $this->add_step(new restore_rebuild_course_cache('rebuild_course_cache'));

        // Clean the temp dir (conditionally) and drop temp table
        $this->add_step(new restore_drop_and_clean_temp_stuff('drop_and_clean_temp_stuff'));

        // If restoring to a new course or overwriting config, reindex the whole course.
        if (\core_search\manager::is_indexing_enabled()) {
            $wholecourse = $this->get_target() == backup::TARGET_NEW_COURSE;
            $wholecourse = $wholecourse || $this->setting_exists('overwrite_conf') && $this->get_setting_value('overwrite_conf');
            if ($wholecourse) {
                $this->add_step(new restore_course_search_index('course_search_index'));
            }
        }

        $this->built = true;
    }
227768
public function generateDocumentation()
    {
        if ($this->documentation !== null) {
            $this->documentation->setIndentationString($this->getIndentationString());
            $this->documentation->setIndentationLevel($this->getIndentationLevel());

            return $this->documentation->generate();
        } else {
            return null;
        }
    }
923307
private function build(): void
    {
        $prefix = "<?xml version='1.0' encoding='UTF-8'?>" . $this->glue() . "<feed xmlns='http://www.w3.org/2005/Atom' xmlns:apps='http://schemas.google.com/apps/2006'>";
        $suffix = '</feed>';

        $xml = collect($this->filters)->map(function ($items) {
            return $this->buildEntry($items);
        })->implode($this->glue());

        $this->xml = collect([$prefix, $xml, $suffix])->implode($this->glue());

        if ($this->writeFile) {
            $this->filesystem->dumpFile($this->outputFile, $this->xml);
        }
    }
723917
protected function build()
    {
        $operation = $this->buildOperation('CreatePaymentToken');

        $merchantID = $this->document->createElement('merchantID', $this->merchantId);
        $operation->appendChild($merchantID);


        $pType = $this->document->createElement('pType', $this->pType);
        $operation->appendChild($pType);

        if ($this->templateSet) {
            $templateSet = $this->document->createElement('templateSet', $this->templateSet);
            $operation->appendChild($templateSet);
        }

        if ($this->style) {
            $style = $this->document->createElement('style', $this->style);
            $operation->appendChild($style);
        }

        if ($this->customerId) {
            $customerId = $this->document->createElement('customerID', $this->customerId);
            $operation->appendChild($customerId);
        }

        if ($this->profileId) {
            $profileId = $this->document->createElement('profileID', $this->profileId);
            $operation->appendChild($profileId);
        }

        if ($this->domain) {
            $domain = $this->document->createElement('domain', $this->domain);
            $operation->appendChild($domain);
        }


        if ($this->language) {
            $language = $this->document->createElement('language', $this->language);
            $operation->appendChild($language);
        }
    }
295472
protected function _buildClass()
    {
        $defineData = $this->_extractData($this->elements);

        $defineParam = $this->parameters;
        $defineProps = $this->properties;

        $docBlock = '';
        foreach ($defineData as $key => $element) {
            $type = $element['type'];
            if ('scalar' === $type) {
                $type = 'string';
            }

            $docBlock .= "\n * @property ".$type.' $'.$key.' '.(isset($element['options']['label']) ? $element['options']['label'] : '');
        }

        array_walk($defineData, function (&$value, $key) {
                    $value = "->defineData('".$key."', '".$value['type']."', ".var_export($value['options'], true).")";
                });
        array_walk($defineParam, function (&$value, $key) {
                    $value = "->defineParam('".$key."', ".var_export($value, true).")";
                });
        array_walk($defineProps, function (&$value, $key) {
                    $value = "->defineProperty('".$key."', ".var_export($value, true).")";
                });

        $phpCode = str_replace(array('<namespace>',
            '<classname>',
            '<repository>',
            '<extends>',
            '<interface>',
            '<trait>',
            '<defineDatas>',
            '<defineParam>',
            '<defineProps>',
            '<docblock>', ), array($this->namespace,
            $this->classname,
            $this->repository,
            $this->extends,
            $this->interfaces,
            $this->traits,
            (0 < count($defineData)) ? '$this'.implode('', $defineData).';' : '',
            (0 < count($defineParam)) ? '$this'.implode('', $defineParam).';' : '',
            (0 < count($defineProps)) ? '$this'.implode('', $defineProps).';' : '',
            $docBlock, ), $this->template);

        return $phpCode;
    }
1183528
public function build()
    {
        $callback = $this->callback;

        // We will create a new class metadata builder instance,
        // so we can use it to easily generated a new mapping
        // array, without re-declaring the existing field
        $builder = $this->newClassMetadataBuilder();

        $source = $this->convertToMappingArray($this->builder);

        // Create a new field builder for the new class metadata builder,
        // based on the existing (to be overridden) field
        $fieldBuilder = $this->getFieldBuilder(
            $builder,
            $source
        );

        $field = $callback($fieldBuilder);

        // When the user forget to return, use the Field instance
        // which contains the same information
        $field = $field ?: $fieldBuilder;

        if (!$field instanceof Field) {
            throw new InvalidArgumentException('The callback should return an instance of '.Field::class);
        }

        $field->build();

        $target = $this->convertToMappingArray($builder);

        $this->builder->getClassMetadata()->setAttributeOverride(
            $this->name,
            $this->mergeRecursively($source, $target)
        );
    }
1923
private function initializePhpDocumentor()
    {
        $phpDocumentorPath = '';

        if (!empty($this->pharLocation)) {
            include_once 'phar://' . $this->pharLocation . '/vendor/autoload.php';

            if (!class_exists('phpDocumentor\\Bootstrap')) {
                throw new BuildException(
                    $this->pharLocation . ' does not look like a phpDocumentor 2 .phar'
                );
            }
        } elseif (class_exists('Composer\\Autoload\\ClassLoader', false)) {
            if (!class_exists('phpDocumentor\\Bootstrap')) {
                throw new BuildException('You need to install phpDocumentor 2 or add your include path to your composer installation.');
            }
        } else {
            $phpDocumentorPath = $this->findPhpDocumentorPath();

            if (empty($phpDocumentorPath)) {
                throw new BuildException("Please make sure phpDocumentor 2 is installed and on the include_path.");
            }

            set_include_path($phpDocumentorPath . PATH_SEPARATOR . get_include_path());

            include_once $phpDocumentorPath . '/phpDocumentor/Bootstrap.php';
        }

        $this->app = \phpDocumentor\Bootstrap::createInstance()->initialize();

        $this->phpDocumentorPath = $phpDocumentorPath;
    }
5275
protected function addDocumentation()
    {
        $docDirectory = $this->getDocumentationDirectory();

        // If there's a documentation directory
        if (is_dir($docDirectory)) {
            $validIndexDocuments = [
                'index.md',
                'readme.md',
                strtolower($this->basename.'.md')
            ];
            $indexDocument       = null;
            $documents           = [];

            // Run through all documentation files
            foreach (scandir($docDirectory) as $document) {
                if (!is_file($docDirectory.DIRECTORY_SEPARATOR.$document)) {
                    continue;
                }

                // If there's a valid documentation index file
                if (in_array(strtolower($document), $validIndexDocuments)) {
                    if ($indexDocument === null) {
                        $indexDocument = $docDirectory.DIRECTORY_SEPARATOR.$document;
                    }
                    continue;
                }

                $documents[] = $docDirectory.DIRECTORY_SEPARATOR.$document;
            }

            // If there's an index document
            if ($indexDocument !== null) {
                $this->addNotice(file_get_contents($indexDocument));

                return;
            }

            // If there are remaining documents: Auto-create a simple listing
            if (count($documents)) {
                $listing = [];

                // Run through all documents
                foreach ($documents as $document) {
                    $extension = strtolower(pathinfo($document, PATHINFO_EXTENSION));
                    $listing[] = '* '.(in_array($extension, ['jpg', 'jpeg', 'png', 'gif', 'svg']) ? '!' : '').
                                 '['.pathinfo($document, PATHINFO_FILENAME).']('.basename($document).')';
                }

                $this->addNotice(implode(PHP_EOL, $listing));
            }
        }
    }
348582
public function
	Build() {
	/*//
	compile the files down to the final form.
	//*/

		if($this->Print) {
			header(sprintf(
				"Content-type: %s",
				$this->GetFullContentType()
			));
		}

		$ds = DIRECTORY_SEPARATOR;
		$source = '';
		$filelist = $this->FindTheFiles();
		$outfile = sprintf(
			"%s{$ds}%s{$ds}%s",
			$this->OutputDir,
			$this->DistDir,
			$this->OutputFile
		);

		if($this->AddScriptHeader) $this->AppendScriptHeader(
			$filelist,
			$source
		);

		foreach($filelist as $filepath)
		$this->AppendFile($filepath,$source);

		if($this->OutputFile) {
			if(!$this->WriteToDisk($outfile,$source)) {
				echo $this->GetComment(
					$this->Print,
					"INFO: output was unchanged with this build.",
					$source
				);

				if($this->Print)
				echo PHP_EOL;
			}
		}

		if($this->Print) {
			echo $source, PHP_EOL;
		}

		return $this;
	}
255754
protected function setupClass() {
		$this->_class->setName($this->getNames()->entityName);
		$this->_class->setExtendedClass($this->getNames()->entityAbstractName);
	
		$docBlock = new DocBlockGenerator();
		$docBlock->setShortDescription("Entity for {$this->getNames()->tableName}");
		$this->_class->setDocBlock($docBlock);
		
		$this->_file->setClass($this->_class);
	}
592719
protected function setupClass() {
		$this->_class->setName($this->getNames()->entityAbstractName);
		$this->_class->setImplementedInterfaces(['RowGatewayInterface']);
		$this->_class->setAbstract(true);
	
		$docBlock = new DocBlockGenerator();
		$docBlock->setShortDescription("Entity for {$this->getNames()->tableName}");
		$tags = [];
		
		$tags[] = [
			'name' => 'namespace',
			'description' => $this->getNames()->namespace_entity
		];
		
		foreach ($this->getNames()->properties as $name => $values) {
			// Extract array to $type, $default, $primary
			$type = null;
			$default = null;
			extract($values);
			
			$property = new PropertyGenerator($name);
			$property->setVisibility('protected');
			if ($default != null) {
				$property->setDefaultValue($default);
			}
			
			$property->setDocBlock(DocBlockGenerator::fromArray([
				'shortDescription' => $name,
				'tags' => [[
					'name' => 'var',
					'description' => $type]]]));
			$this->_class->addPropertyFromGenerator($property);
			
			$tags[] = [
				'name' => 'property',
				'description' => "{$type} \${$name}"
			];
		}
		$docBlock->setTags($tags);
		$this->_class->setDocBlock($docBlock);
		
		$docBlock = DocBlockGenerator::fromArray([
			'shortDescription' => 'DataTable Link',
			'tags' => [[
				'name' => 'var',
				'description' => "\\{$this->getNames()->namespace_model}\\{$this->getNames()->modelName}"]]]);
		
		$property = new PropertyGenerator();
		$property->setName('dataTable');
		$property->setDocBlock($docBlock);
		$property->setVisibility('private');
		$this->_class->addPropertyFromGenerator($property);
		
		$this->_file->setClass($this->_class);
	}