Parse the given filter and options.

@param  \Closure|string  $name
@param  array  $options
@return array
341097
protected function parseFilter($filter, array $options)
	{
		$parameters = array();

		$original = $filter;

		if ($filter instanceof Closure)
		{
			$filter = $this->registerClosureFilter($filter);
		}
		elseif ($this->isInstanceFilter($filter))
		{
			$filter = $this->registerInstanceFilter($filter);
		}
		else
		{
			list($filter, $parameters) = Route::parseFilter($filter);
		}

		return compact('original', 'filter', 'parameters', 'options');
	}
104853
public function contentTag($name, $content, array $options = array(), $escape = false)
    {
        if ($content instanceof \Closure) {
            ob_start();
            $tmpContent = $content();
            $content = ob_get_clean();
            if ($tmpContent !== null) {
                $content = $tmpContent;
                unset($tmpContent);
            }
        }
        return $this->_content_tag_string($name, $content, $options, $escape);
    }
65455
public function getOption(string $name, $default = null)
    {
        $value = array_key_exists($name, $this->options) ? $this->options[$name] : $default;

        if ($value && ($value instanceof \Closure)) {
            $value = $value();
        }

        return $value;
    }
867659
public static function file($name, $options = [])
    {
        self::exclure($options);

        return self::input('file', $name, null, $options);
    }
267210
public function getRequired($name, array $options = [])
    {
        $options = $this->options($options);
        $value   = $this->helper()->arr()->getRequired($this->storage(), $name);

        return $this->decrypt($value, $options);
    }
374754
public function filter($name, array $options = [])
    {
        if (static::EXT_FILTER === parent::filter($name, $options) and isset($this->filters[$name])) {
            $filter = new $this->filters[$name]($this, $options);

            $filterResults = $filter->run();

            if (!empty($filterResults)) {
                $this->commands = array_merge($this->commands, (array)$filterResults);
            }
        }
    }
1197266
public function get($name, $options = [], $usePeeringServiceManagers = false)
    {
        if (is_string($options)) {
            $options = ['class_name' => $options];
        }

        return parent::get($name, $options, $usePeeringServiceManagers);
    }
1196817
public function getClosureForSearch(array $options): Closure
    {
        return function ($language) use ($options) {
            $json = $this->parent->performAPICallWithJsonResponse(
                'get',
                '/search/series',
                array_merge($options, ['headers' => ['Accept-Language' => $language]])
            );
            return DataParser::parseDataArray($json, BasicSeries::class);
        };
    }
392839
protected function parseOptions(array $options)
    {
        $options = array_merge($this->defaultOptions, $options);

        foreach ($options as $option => $value) {
            if (! in_array($option, $this->allowedOptions, true)) {
                throw new \InvalidArgumentException("Option [$option] is not allowed.");
            }
        }

        return $options;
    }
567914
static function GetData($name, $filter = FILTER_DEFAULT, $options = null)
    {
        return filter_input(INPUT_GET, $name, $filter, $options);
    }
593522
public function contentTag($name, $content, array $options = array(), $escape = false)
    {
        if ($content instanceof \Closure) {
            ob_start();
            $ret     = $content();
            $content = ob_get_clean();
            if ($ret !== null) {
                $content = $ret;
            }
        }
        return $this->contentTagString($name, $content, $options, $escape);
    }
383159
public function get($name, array $options = array())
    {
        $name = strtolower((string) $name);

        if (!$this->has($name)) {
            throw new InvalidArgumentException(sprintf('Unrecognized compressor "%s"', $name));
        }

        $mapping = $this->getMapping();
        $className = $mapping[$name];

        if ($options === array()) {
            return new $className();
        }

        $reflection = new \ReflectionClass($className);
        return $reflection->newInstanceArgs($options);
    }
1000677
private function findCall($name, array $options = [])
    {
        $tasks    = array_keys($this->container->findTaggedServiceIds('bldr'));
        $services = [];
        foreach ($tasks as $serviceName) {
            /** @var TaskInterface|AbstractTask $service */

            $service = $this->container->get($serviceName);
            if ($service instanceof AbstractTask) {
                $service->configure();
            }

            if (method_exists($service, 'setEventDispatcher')) {
                $service->setEventDispatcher($this->container->get('bldr.dispatcher'));
            }

            foreach ($options as $name => $value) {
                $service->setParameter($name, $value);
            }

            if (method_exists($service, 'validate')) {
                $service->validate();
            }

            if ($service->getName() === $name) {
                $services[] = $service;
            }
        }

        if (sizeof($services) > 1) {
            throw new \Exception("Multiple calls exist with the '{$name}' tag.");
        }
        if (sizeof($services) === 0) {
            throw new \Exception("No task type found for {$name}.");
        }

        return $services[0];
    }
641640
public function filter($name, array $options = [])
    {
        $result = static::INT_FILTER;

        if ($this->isMultipartImage()) {
            $this->resource = $this->resource->coalesceImages();
        }

        foreach ($this->resource as $frame) {
            $result = $this->callParentFilter($name, $options);
        }


        if (static::EXT_FILTER === $result and isset($this->filters[$name])) {

            $filter = new $this->filters[$name]($this, $options);

            foreach ($this->resource as $frame) {
                $filter->run();
            }
        }

    }
1158302
public function parseDefaults($name, $options)
    {
        $model = $this->config->getDataModel();

        //if the name is not a string or the options is not an array at this point, throw an error because we can't do anything with it
        if (!is_string($name) || !is_array($options)) {
            throw new \InvalidArgumentException('A custom action in your  '.$this->config->getOption('action_name').' configuration file is invalid');
        }

        //set the action name
        $options['action_name'] = $name;

        //set the permission
        $permission                = $this->validator->arrayGet($options, 'permission', false);
        $options['has_permission'] = is_callable($permission) ? $permission($model) : true;

        //check if the messages array exists
        $options['messages'] = $this->validator->arrayGet($options, 'messages', array());
        $options['messages'] = is_array($options['messages']) ? $options['messages'] : array();

        return $options;
    }
286548
protected static function parseParameterFilter($filter)
	{
		list($name, $parameters) = explode(':', $filter, 2);

		return array($name, explode(',', $parameters));
	}
759697
public function block($name, $options=[]) {

        if (!isset($this->blocks[$name])) return null;

        $options = \array_merge([
            'print' => true
        ], $options);

        $block = \implode("\n", $this->blocks[$name]);

        if ($options['print']){
            echo $block;
        }

        return $block;
    }