Update salts in the environment file.

@param bool $force Whether or not to force update any existing values

@return Collection
555390
protected function update_salts($force = false)
    {
        return $this->salts->map(function ($salt) use ($force) {
            list($key, $value) = $salt;

            if (! $force && $this->env->hasKey($key)) {
                WP_CLI::line("The '$key' already exists, skipping.");
                $salt['skipped'] = true;
                return $salt;
            }

            $this->env->set($key, $value, "'");

            return $salt;
        });
    }
475889
protected function getHttpClient(bool $force = false): HttpClient
    {
        if ($this->_httpClient === null || $force) {
            $config = ArrayHelper::merge(['class' => HttpClient::class], $this->httpClientConfig);
            $config['baseUrl'] = $this->getBaseUrl();

            return $this->_httpClient = Yii::createObject($config);
        } else {
            return $this->_httpClient;
        }
    }
718245
public function squash($force = false) {
        if ($this->cache !== null && !$force) return $this->cache;
        if ($this->parent) {
            return $this->cache = array_merge($this->parent->squash($force), $this->data);
        } else {
            return $this->cache = $this->data;
        }
    }
1360458
public function sluggify($force = false)
    {
        /** @var \Dimsav\Translatable\Translatable $this */
        /** @var \Cviebrock\EloquentSluggable\SluggableInterface $translation */
        $translation = $this->getTranslation();

        if ( ! empty($translation)) {

            $translation->sluggify($force);
        }

        return $this;
    }
691500
public function composerUpdate(bool $force = false): void
	{
		$this->maintenance();
		if ($force) {
			$this->composer->update();
		} else {
			$this->composer->authorizedUpdate();
		}
		$this->maintenance(false);
	}
1108671
public function drop($force = false)
    {
        $this->clearCache();
        
        $this->force = $force;

        return 'DROP TABLE ' . ($this->isForce() ? 'IF EXISTS ' : '') . '`' . $this->getCurrentTable()->getFullTableName() . '`;';
    }
618401
public function remove($force = false)
    {
        $isEmpty = $this->isEmpty();
        if ($force && !$isEmpty) {
            $it = new \RecursiveDirectoryIterator($this->dir, \RecursiveDirectoryIterator::SKIP_DOTS);
            $files = new \RecursiveIteratorIterator($it, \RecursiveIteratorIterator::CHILD_FIRST);
            foreach($files as $file) {
                if ($file->isDir()){
                    \rmdir($file->getRealPath());
                } else {
                    \unlink($file->getRealPath());
                }
            }

            \rmdir($this->dir);
            $this->removed = true;

            return;
        }

        if ($isEmpty) {
            \rmdir($this->dir);
            $this->removed = true;
        }
    }
938179
public function fill(array $input, bool $force = false)
    {
        foreach ($input as $key => $value) {
            if ($force) {
                $this->setAttribute($key, $value);

                continue;
            }

            if ((empty($this->fillable) || in_array($key, $this->fillable)) && !in_array($key, $this->guarded)) {
                $this->setAttribute($key, $value);
            }
        }
    }
628929
public function setValues($values, $force=true) {
		$count=$this->count();
		$valuesSize=\sizeof($values);
		if ($this->_createCols === false || $force === true) {
			for($i=$count; $i < $valuesSize; $i++) {
				$colSize=\sizeof($values[$i]);
				$this->addItem(new HtmlGridRow($this->identifier . "-row-" . ($this->count() + 1), $colSize, $this->_colSizing, $this->_implicitRows));
			}
		}
		$count=\min(array ($this->count(),$valuesSize ));
		for($i=0; $i < $count; $i++) {
			$this->content[$i]->setValues($values[$i], $this->_createCols === false);
		}
	}
1332653
public function setAttributes($attributes, $force = false)
    {
        $original = $this->attributes;

        if ($force) {
            $this->attributes = $attributes;
        } else {
            foreach ($attributes as $key => $value) {
                $this->set($key, $value);
            }
        }
        return $original;
    }
251273
public function cacheConfig($force = false)
    {
        if ($this->cacheFile->exists() && $force === false) {
            return;
        }
        $this->cacheFile->dump($this->data);
    }
601507
public function isOffline( $force = FALSE ){
		if( $this->status === self::STATUS_UNKNOWN || $force )
			$this->check();
		return $this->status === self::STATUS_OFFLINE;
	}
278192
public function generateHash($force = false)
    {
        if ($this->lineItem === false) {
            $this->itemHash = null;

            $cartItemArray = (array) $this;

            unset($cartItemArray['options']['qty']);

            ksort($cartItemArray['options']);

            $this->itemHash = app(LaraCart::HASH)->hash($cartItemArray);
        } elseif ($force || empty($this->itemHash) === true) {
            $this->itemHash = app(LaraCart::RANHASH);
        }

        app('events')->dispatch(
            'laracart.updateItem', [
                'item'    => $this,
                'newHash' => $this->itemHash,
            ]
        );

        return $this->itemHash;
    }
423286
public function refresh(bool $force = false, bool $cascade = false) : bool
    {
        $this->relinkDB();
        return $this->load();
    }
991462
public function check($force = false)
    {
        /*
         * Already know about updates, never retry.
         */
        $oldCount = Parameter::get('system::update.count');
        if ($oldCount > 0) {
            return $oldCount;
        }

        /*
         * Retry period not passed, skipping.
         */
        if (!$force
            && ($retryTimestamp = Parameter::get('system::update.retry'))
            && Carbon::createFromTimeStamp($retryTimestamp)->isFuture()
        ) {
            return $oldCount;
        }

        try {
            $result = $this->requestUpdateList();
            $newCount = array_get($result, 'update', 0);
        }
        catch (Exception $ex) {
            $newCount = 0;
        }

        /*
         * Remember update count, set retry date
         */
        Parameter::set('system::update.count', $newCount);
        Parameter::set('system::update.retry', Carbon::now()->addHours(24)->timestamp);

        return $newCount;
    }
561064
public static function update($force = false)
    {
        if (!defined('SEMALT_UNIT_TESTING') && !self::isWritable()) {
            return;
        }

        if (!$force && !self::isOutdated()) {
            return;
        }

        self::doUpdate();
    }
15671
public function get($force = false)
    {
        // Check if current set
        if (is_null(self::$current) || $force) {
            // Get environment variable (if set and valid)
            $releaseStage = trim(getenv('RELEASE_STAGE'));
            $releaseStage = in_array($releaseStage, $this->getAll()) ? $releaseStage : null;

            // If environment variable not set/valid, try to detect environment by url or path
            $releaseStage = $releaseStage ?: $this->determineFromPath();

            $releaseStage = $releaseStage ?: $this->detectAppServer();

            // If environment variable still not set, assume we are in production!
            $releaseStage = $releaseStage ?: self::PRODUCTION;

            self::$current = $releaseStage;
        }

        return self::$current;
    }