Formats the plugins options.

@param bool $strict

@return string
765843
public function formatPlugins(bool $strict = false, bool $noBraces = false)
    {
        if (!$strict && count($this->plugins) === 0) {
            return '';
        }

        $plugins = str_replace('"', '', Encoder::encode($this->plugins));

        return $noBraces ? substr($plugins, 1, -1) : $plugins;
    }
728259
public function format($format = '')
    {
        if ($this->isHollow()) {
            $format = $this->format;
        } else {
            $format = $format ?: $this->format;
        }

        return parent::format($format);
    }
465919
public function cleanUri($uri, $strict = false)
	{
		$filters = $this->config['uri_filter'];
		$filters = is_array($filters) ? $filters : array($filters);

		if ($strict)
		{
			$uri = preg_replace(array("/\.+\//", '/\/+/'), '/', $uri);
		}

		return $this->clean($uri, $filters);
	}
948675
public function where($property, $value, $strict = true)
    {
        return $this->filter(function ($object) use ($property, $value, $strict) {

            if (!array_key_exists($property, $object->settings)) {
                return false;
            }

            return $strict
                ? $object->settings[$property] === $value
                : $object->settings[$property] == $value;
        });
    }
879368
public static function getValueName($value, $strict = false)
    {
        if (!static::isValidValue($value)) {
            throw new \InvalidArgumentException('No enum name was found for the value supplied.');
        }

        return array_search($value, static::$constants, $strict);
    }
754661
public function supports(&$extensions) {
        $classname = '\media_'.$this->name.'_plugin';
        if (class_exists($classname)) {
            $object = new $classname();
            $result = $object->supports($extensions);
            foreach ($object->get_supported_extensions() as $ext) {
                $extensions[$ext] = $ext;
            }
            return $result;
        }
        return '';
    }
271634
public function search($value, bool $strict = false)
    {
        return array_search($value, $this->storage, $strict);
    }
629171
public function setStrictVariables($strict)
    {
        if ((bool) $strict) {
            $this->templating->enableStrictVariables();
        } else {
            $this->templating->disableStrictVariables();
        }
    }
654539
function $true(params) {
    if (typeof params === 'boolean') {
        return params;
    }
    if (typeof params === 'number') {
        return params === 1;
    }
    if (typeof params === 'string') {
        params = params.trim();

        return params.toLowerCase() === 'true' || params === '1';
    }

    return false;
}
881751
public function formatOptions(bool $strict = false, bool $noBraces = false)
    {
        $colors = [];
        $default = 0;
        foreach ($this->datasets as $dataset) {
            $color = $this->default_colors[$default];
            if (array_key_exists('color', $dataset->options)) {
                $color = $dataset->options['color'];
                unset($dataset->options['color']);
            } else {
                $default++;
            }
            array_push($colors, $color);
        }

        $this->options([
            'colors' => $colors,
        ]);

        return parent::formatOptions($strict, $noBraces);
    }
82401
public function where($key, $value, $strict = true)
    {
        return $this->filter(function ($item) use ($key, $value, $strict) {
            return $strict ? ArrayHelper::getValue($item, $key) === $value
                : ArrayHelper::getValue($item, $key) == $value;
        });
    }
1134249
protected function formatCallable(array $specs)
    {
        if (isset($specs['can'])) {
            $callback = json_encode($specs['can']);

            return "Gate::check({$callback})";
        }

        if (! isset($specs['do'])) {
            return '';
        }

        $callback = $specs['do'];

        if ($callback instanceof \Closure) {
            return 'Closure';
        }

        if (is_string($callback)) {
            if (strpos($callback, '@') !== false) {
                $callback = explode('@', $callback);
            } else {
                return $callback.'()';
            }
        }

        if (is_array($callback)) {
            return implode('::', $callback).'()';
        }

        return $callback;
    }
1170757
protected function parseRequiredProperties(bool $refresh = false)
    {
        if ($this->requiredParsed !== null && !$refresh) {
            return $this->requiredParsed;
        }

        foreach ($this->required as $index => $item) {
            $property = is_int($index) ? $item : $index;
            $type = 'any';

            if (in_array($property, $this->ignored)) {
                continue;
            }

            if (isset($this->requiredTypes[$property])) {
                $type = $this->requiredTypes[$property];
            } elseif (!is_int($index) && $item !== '*' && !$this->allRequired) {
                $type = $item;
            }

            $this->requiredParsed[$property] = $this->parseAllowedTypes($type);
        }

        return $this->requiredParsed;
    }
905468
public static function hasValue($value, bool $strict = true): bool
    {
        $validValues = static::getValues();

        if ($strict) {
            return in_array($value, $validValues, true);
        }

        return in_array((string) $value, array_map('strval', $validValues), true);
    }
856608
public function replaceNonAlpha(string $replacement = '', bool $strict = false): Utility
    {
        if ($strict) {
            $pattern = '/[^a-zA-Z]/';
        } else {
            $pattern = '/[^a-zA-Z ]/';
        }

        $string = preg_replace($pattern, $replacement, trim($this->string));

        return new static($string, $this->encoding);
    }
889504
public function getFormatForFileExtension($extension)
    {
        $format = $this->getConfiguredFormat();
        if ($format === static::FORMAT_AUTO) {
            $format = $this->getAutomaticFormatForFileExtension((string) $extension);
        }

        return $format;
    }
324107
public function toString($default=true)
    {
        $options = array();
        $binder = new Database\Binder();

        foreach ($this as $key=>$value) {
            $options[] = ($value === $default)
                ? $key
                : sprintf("%s=%s", $key, urlencode($value))
                ;
        }

        return implode(' ', $options);
    }