Build scaffold object from user inputs

@return \stdClass
192803
protected function _buildScaffold()
    {
        $oScaffold = new \stdClass();
        $oScaffold->sVendor = strtolower($this->_getUserInput('Vendor Prefix', true));

        $blFirstRequest = true;

        do {

            if (!$blFirstRequest) {
                $this->output->writeLn('Module path or id is taken with given title');
            } else {
                $blFirstRequest = false;
            }

            $oScaffold->sModuleTitle = $this->_getUserInput('Module Title');
            $oScaffold->sModuleName = str_replace(' ', '', ucwords($oScaffold->sModuleTitle));
            $oScaffold->sModuleId = $oScaffold->sVendor . strtolower($oScaffold->sModuleName);

        } while (!$this->_modulePathAvailable($oScaffold->sVendor, $oScaffold->sModuleName)
            || !$this->_moduleIdAvailable($oScaffold->sModuleId));

        $oScaffold->sModuleDir = $this->_getModuleDir($oScaffold->sVendor, $oScaffold->sModuleName);
        $oScaffold->sAuthor = $this->_getUserInput('Author', true);
        $oScaffold->sUrl = $this->_getUserInput('Url', true);
        $oScaffold->sEmail = $this->_getUserInput('Email', true);

        return $oScaffold;
    }
581932
protected function _buildObject() {
		$objectAttributes = $objectParams = '';

		foreach ($this->_objectAttributes as $param => $value) {
			$objectAttributes .= ' ' . $param . '="' . $value . '"';
		}

		foreach ($this->_objectParams as $param => $value) {
			$objectParams .= '<param name="' . $param . '" value="' . $value . '" />';
		}

		if (!$objectAttributes && !$objectParams) {
			return '';
		}
		return sprintf('<object %s> %s</object>', $objectAttributes, $objectParams);
	}
864283
public function build()
	{
		$filterMapper = $this->getMapper();
		$input = Input::all();

		$result = new FilterResult();
		foreach ($filterMapper->getFields() as $field) {
			$clone = clone $field;
			$name  = $clone->getName();

			if (Input::has($name)) {
				$clone->setValue($input[$name]);
			}

			$clone->setContext(BaseField::CONTEXT_FILTER);

			$result->addField($name, $clone);
		}
		$this->setResult($result);
	}
1000120
private function build() {

    	if(null === $this -> text) {

    		$html = '<input type="'. $this -> type .'"';
    		
    		foreach($this -> attributes as $attribute => $value) {
    		    $html .= ' ' . $attribute . '="'. Escape :: attr($value) .'"';
    		}

    		$html .= '>';

    		return $html;
    	}

        $this -> fill();
        
        $html = '<button';
        
        foreach($this -> attributes as $attribute => $value) {
            $html .= ' ' . $attribute . '="'. Escape :: attr($value) .'"';
        }

        $html .= '>' . Escape :: html($this -> text) . '</button>';

        return $html;
        
    }
34697
public function build(): GetComputedStyleForNodeRequest
	{
		$instance = new GetComputedStyleForNodeRequest();
		if ($this->nodeId === null) {
			throw new BuilderException('Property [nodeId] is required.');
		}
		$instance->nodeId = $this->nodeId;
		return $instance;
	}
644620
public function build(): RequestDataRequest
	{
		$instance = new RequestDataRequest();
		if ($this->securityOrigin === null) {
			throw new BuilderException('Property [securityOrigin] is required.');
		}
		$instance->securityOrigin = $this->securityOrigin;
		if ($this->databaseName === null) {
			throw new BuilderException('Property [databaseName] is required.');
		}
		$instance->databaseName = $this->databaseName;
		if ($this->objectStoreName === null) {
			throw new BuilderException('Property [objectStoreName] is required.');
		}
		$instance->objectStoreName = $this->objectStoreName;
		if ($this->indexName === null) {
			throw new BuilderException('Property [indexName] is required.');
		}
		$instance->indexName = $this->indexName;
		if ($this->skipCount === null) {
			throw new BuilderException('Property [skipCount] is required.');
		}
		$instance->skipCount = $this->skipCount;
		if ($this->pageSize === null) {
			throw new BuilderException('Property [pageSize] is required.');
		}
		$instance->pageSize = $this->pageSize;
		$instance->keyRange = $this->keyRange;
		return $instance;
	}
358914
public function scaffold()
    {
        $this->updateDependencies([
            "vue" => "^2.4.3",
        ]);
        $this->updateDevDependencies([
            "vue-loader" => "^13.3.0",
            "vue-template-compiler" => "^2.5.2",
        ]);
        $this->updateJavascript($this->name);
        $this->updateAssets($this->name);
    }
1102785
public function build()
    {
        $settings = [];
        foreach ($this->settings as $name => $options) {
            if (isset($options['dsn'])) {
                unset(
                    $options['scheme'],
                    $options['host'],
                    $options['port'],
                    $options['path']
                );

                $parsedDsn = parse_url($options['dsn']);
                unset($options['dsn']);
                if ($parsedDsn) {
                    $options['scheme'] = isset($parsedDsn['scheme']) ? $parsedDsn['scheme'] : 'http';
                    if (isset($parsedDsn['host'])) {
                        $options['host'] = $parsedDsn['host'];
                    }
                    if (isset($parsedDsn['user'])) {
                        $auth = $parsedDsn['user'] . (isset($parsedDsn['pass']) ? ':' . $parsedDsn['pass'] : '');
                        $options['host'] = $auth . '@' . $options['host'];
                    }
                    $options['port'] = isset($parsedDsn['port']) ? $parsedDsn['port'] : 80;
                    $options['path'] = isset($parsedDsn['path']) ? $parsedDsn['path'] : '';
                }
            }

            $settings[$name] = $options;
        }

        $solariumClient = new Client(array('endpoint' => $settings), $this->eventDispatcher);
        foreach ($this->plugins as $pluginName => $plugin) {
            $solariumClient->registerPlugin($pluginName, $plugin);
        }

        return $solariumClient;
    }
735980
public function build()
    {
        if ($this->handler) {
            $handler = $this->handler;
        } elseif ($this->pdo || $this->dbCredentials) {
            $options = $this->dbCredentials;
            $options['table'] = $this->table;
            if ($this->pdo) {
                $options['pdo'] = $this->pdo;
            }
            $handler = new PdoHandler($options);
        } else {
            $handler = new FileHandler($this->locking);
        }
        return new Session($handler, $this->name, $this->savePath, $this->serializer);
    }
671226
public function copy()
	{
		$class = __NAMESPACE__ . '\\Scaffolding\\' . ucfirst($this->type);

		if (class_exists($class))
		{
			$obj = new $class($this->output, $this->arguments);
		}
		else
		{
			if (empty($this->type))
			{
				$this->output->error('Error: Sorry, scaffolding can\'t copy nothing. Try telling it what you want to copy.');
			}
			else
			{
				$this->output->error('Error: Sorry, scaffolding doesn\'t know how to copy a ' . $this->type);
			}
		}

		if (!method_exists($obj, 'doCopy'))
		{
			$this->output->error('Error: scaffolding doesn\'t know how to copy a ' . $this->type);
		}

		// Do the actual copy
		$obj->doCopy();
	}
951459
protected function getFormGenerator()
    {
        if (null === $this->formGenerator) {
            $this->formGenerator = new FormGenerator($this->getContainer()->get('filesystem'),  __DIR__.'/../Resources/skeletons/form');
        }

        return $this->formGenerator;
    }
332522
public function generate()
    {
        $form = collect([]);

        // Loop all the the fields in the schema
        foreach ($this->schema->all() as $name => $input) {

            // Skip the one that don't have a `form` definition
            if (isset($input['form'])) {

                // Get the value from the data
                $value = isset($this->data[$name]) ? $this->data[$name] : null;

                // Add the namespace to the name if it's defined
                $name = ($this->formNamespace != '') ? $this->formNamespace.'['.$name.']' : $name;

                // Get the element class and make sure it exist
                $type = (isset($input['form']['type'])) ? $input['form']['type'] : 'text';
                $type = 'UserFrosting\\Sprinkle\\FormGenerator\\Element\\'.Str::studly($type);

                // If class doesn't esist, default to Text element
                if (!class_exists($type)) {
                    $type = 'UserFrosting\\Sprinkle\\FormGenerator\\Element\\Text';
                }

                // Create a new instance
                $element = new $type($name, $input['form'], $value);

                // Push data to `$form`
                $form->put($name, $element->parse());
            }
        }

        return $form->toArray();
    }
533158
public function build(): QueryObjectsRequest
	{
		$instance = new QueryObjectsRequest();
		if ($this->prototypeObjectId === null) {
			throw new BuilderException('Property [prototypeObjectId] is required.');
		}
		$instance->prototypeObjectId = $this->prototypeObjectId;
		$instance->objectGroup = $this->objectGroup;
		return $instance;
	}
937422
public function build(): GetDocumentRequest
	{
		$instance = new GetDocumentRequest();
		$instance->depth = $this->depth;
		$instance->pierce = $this->pierce;
		return $instance;
	}
261902
private function createRequestClass()
    {
        $requestClassName = $this->getRequestClass();
        $requestFilePath = $this->getModulePath("Requests/{$requestClassName}.php");

        if (file_exists($requestFilePath)) {
            $this->info('Request file exists. Skip.');
            return $requestFilePath;
        }

        $requestContent = view('scaffold::request', [
            'moduleNameSpace' => $this->getModuleNamespace(),
            'className'       => $requestClassName,
        ])->render();

        Utils::writeFile($requestFilePath, $requestContent);
        $this->info('Request class is set: ' . $requestClassName);
        $this->line($requestFilePath);

        return $requestFilePath;
    }
1148140
protected function makeComponentBlueprint()
    {
        $blueprint = new Blueprint(self::COMPONENT_CLASS, [

            new CustomInstruction(function (Scaffold $s) {
                if ($s->input instanceof Closure) {
                    $s->class = 'Nayjest\Grids\Components\RenderFunc';
                    $s->constructor_arguments = [$s->input];
                    $s->input = [];
                } elseif (is_string($s->input)) {
                    $s->class = 'Nayjest\Grids\Components\RenderFunc';
                    $out = $s->input;
                    $s->constructor_arguments = [function () use ($out) {
                        return $out;
                    }];
                    $s->input = [];
                }
            }, Instruction::PHASE_PRE_INST),
            new CustomMapping('type', function ($type, Scaffold $s) {
                if (strpos($type, '\\') !== false) {
                    $s->class = $type;
                } else {
                    $s->class = 'Nayjest\Grids\Components\\' . str_replace(
                            ' ',
                            '',
                            ucwords(str_replace(array('-', '_'), ' ', $type))
                        );
                }
            }, null, Instruction::PHASE_PRE_INST)
        ]);
        $blueprint->add(new BuildChildren('components', $blueprint));

        $blueprint->add(new Rename('component', 'add_component'));
        $blueprint->add(new Build('add_component', $blueprint));
        $blueprint->add(new CallMethodWith('add_component','addComponent'));

        return $blueprint;
    }
284508
public function build(): GetScriptSourceRequest
	{
		$instance = new GetScriptSourceRequest();
		if ($this->scriptId === null) {
			throw new BuilderException('Property [scriptId] is required.');
		}
		$instance->scriptId = $this->scriptId;
		return $instance;
	}