Prepare default crude setup
@return self
328975
public function prepareModelCrudeSetup()
    {
        $crudeName = $this->getCalledClassName();
        $modelAttr = array_merge(['id'], $this->model->getFillable(), ['created_at']);

        foreach ($modelAttr as $attr)
            $this->scope[$attr] = $this->model->getTable() . '.' . $attr;

        $this->crudeSetup = new CrudeSetup($crudeName, $modelAttr);

        if ($this->cannotUpdate())
            $this->crudeSetup->lockEditOption();

        if ($this->cannotStore('check with permission'))
            $this->crudeSetup->lockAddOption();

        if ($this->cannotDelete())
            $this->crudeSetup->lockDeleteOption();

        if ($this->cannotOrder())
            $this->crudeSetup->lockOrderOption();

        $this->crudeSetup->setFilters(['id']);

        return $this->crudeSetup;
    }
144349
public function prepare() {
        $this->inlineCode = $this->buildInlineCode();
        $this->addGlobalCode($this->buildGlobalCode());
        return $this;
    }
636705
public function setDefaultsFromConfiguration()
    {
        $set = [
            "urlType",
            "siteUrl",
            "baseUrl",
            "staticSiteUrl",
            "staticBaseUrl",
            "scriptName",
        ];
        
        foreach ($set as $item) {
            if (!isset($this->config[$item])) {
                continue;
            }
            
            $this->$item = $this->config[$item];
        }

        return $this;
    }
884210
public function prePersist()
    {
        if (!$this->getCreatedAt()) {
            $this->setCreatedAt(new \DateTime());
        }

        if (!$this->getUpdatedAt()) {
            $this->setUpdatedAt(new \DateTime());
        }
    }
740527
protected function prepareProcessContext()
    {
        if (null !== $this->context) {
            $this->context->setData($this->data);
            $this->context->setProcessor($this);
            return;
        }

        $class = $this->processContextClass;

        $this->context = new $class($this->data, $this->settings, $this);

    }
1323052
public function setup() {
		$this->errorHandler = $errorHandler = \Asgard\Debug\ErrorHandler::register();
		if(php_sapi_name() !== 'cli')
			\Asgard\Debug\Debug::setFormat('html');

		register_shutdown_function([$this, 'shutdownFunction']);
		$this->addShutdownCallback([$errorHandler, 'shutdownFunction']);

		$compiledFile = $this->getCompiledFile();
		if($compiledFile && file_exists($compiledFile))
			include_once $compiledFile;

		return $this;
	}
659181
private function prepareCommandLine()
    {
        $this->commandLine->setExecutable($this->getPhp());
        //We are un-shifting arguments to the beginning of the command line because arguments should be at the end
        $this->commandLine->createArgument(true)->setValue($this->getCommand());
        $this->commandLine->createArgument(true)->setValue($this->getComposer());
        $commandLine = (string) $this->commandLine;
        //Creating new Commandline instance. It allows to handle subsequent calls correctly
        $this->commandLine = new Commandline();

        return $commandLine;
    }
966494
protected function prepare()
    {
        $this->initPurifier($this->config->getPurifierCacheLocation());

        $this->oldText = $this->purifyHtml($this->oldText);
        $this->newText = $this->purifyHtml($this->newText);
    }
451302
public function build()
    {
        $client         = $this->buildClient();
        $requestHandler = $this->getRequestHandler();
        // Pass through any configuration options set here which need to be made
        // available elsewhere in the ThisData instance.
        $configuration  = [
            self::CONF_EXPECT_JS_COOKIE => $this->expectJsCookie
        ];

        return new ThisData($client, $requestHandler, $configuration);
    }
1014471
protected function construct():parent
	{
		$name= $this->line->pregGet('/(?<=^~)[\w-]*/');
		$this->name=$name;

		$this->loadConfig($name,$this->htsl);

		$this->param= $this->line->pregGet('/^~[\w-]*\( (.*) \)/',1);

		$this->structureName=$this->config['name']??$name;

		$this->id=strtoupper(uniqid());

		return $this;
	}
184493
protected function initializeAssetsDir()
    {
        $this->filesystem->ensureDirectoryExists($this->assets_dir);
        $this->assets_dir = realpath($this->assets_dir);
        return $this;
    }
1331082
public function setDefaultsFromConfiguration()
    {
        $this->ignoreCache = isset($this->config["ignoreCache"])
            ? $this->config["ignoreCache"]
            : $this->ignoreCache;

        return $this;
    }
193387
protected function setUpTheBrowserEnvironment()
    {
        Browser::$baseUrl = $this->baseUrl();

        $this->prepareDirectories();

        Browser::$userResolver = function () {
            return $this->user();
        };
    }
342927
protected function initialize()
    {
        $this->configuration = new ValueHolder($this->loadConfiguration());
        $this->defaults = new ValueHolder($this->getDefaults());

        return $this;
    }
681128
public function construct()
	{
		if ($this->arguments->getOpt(4))
		{
				$extension = $this->arguments->getOpt(4);
				$this->addReplacement('plugin_name', $extension);
				$this->addReplacement('extension', $extension);
		}
		else
		{
			$this->output->error("Error: must specify a hubtype.");
		}

		// Determine our base path
		$base       = $this->arguments->getOpt('app') ? PATH_APP : PATH_CORE;
		$installDir = trim($this->arguments->getOpt('install-dir'));
		if ($installDir && strlen($installDir) > 0)
		{
			if (substr($installDir, 0, 1) == DS)
			{
				$base = rtrim($installDir, DS);
			}
			else
			{
				$base .= DS . trim($installDir, DS);
			}
		}

		// Install directory is migrations folder within base
		$installDir = $base . DS . 'plugins' . DS . 'search';

		// Editor
		$editor = null;
		if ($this->arguments->getOpt('editor'))
		{
			$editor = $this->arguments->getOpt('editor');
		}
		else
		{
			$editor = (getenv('EDITOR')) ? getenv('EDITOR') : 'vi';
		}

		// @TODO detect previous file, warn about override

		// Make plugin file
		$classname   = 'plgSearch' . ucfirst($extension);
		$destination = $installDir . DS . $extension . DS .  $extension. '.php';

		// Make directory
		if (!is_dir($installDir. DS . $extension))
		{
			App::get('filesystem')->makeDirectory($installDir . DS . $extension);
		}

		$this->addTemplateFile("{$this->getType()}.tmpl", $destination)
			 ->addReplacement('class_name', $classname)
			 ->make();
	}
593902
public function create(): self
    {
        $this->payload = null;
        $this->aad = null;
        $this->recipients = [];
        $this->sharedProtectedHeader = [];
        $this->sharedHeader = [];
        $this->compressionMethod = null;
        $this->contentEncryptionAlgorithm = null;
        $this->keyManagementMode = null;

        return $this;
    }
1166766
protected function setDefault()
    {
        if (strpos($this->input, '=')) {
            list($this->input, $this->default) = explode('=', $this->input);

            $this->modeArray[] = 'OPTIONAL';
        }

        return $this;
    }