Filter by string.

@return void

@SuppressWarnings(PHPMD.UnusedLocalVariable)
@SuppressWarnings(PHPMD.CyclomaticComplexity)
346059
public static function filterByString($filter)
    {
        $operator = Arr::get($filter, 'operator');
        $method = Arr::get($filter, 'method');
        $arguments = Arr::get($filter, 'arguments');
        $value_one = Arr::get($filter, 'value_one');
        $value_two = Arr::get($filter, 'value_two');
        $settings = Arr::get($filter, 'settings');
        $positive = Arr::get($filter, 'positive');

        switch ($operator) {
            case '=':
            case '!=':
                $arguments = [$operator, $value_one];
                break;
            case '*=*':
            case '*!=*':
                $operator = (stripos($operator, '!') !== false) ? 'not ' : '';
                $operator .= 'like';
                $arguments = [$operator, '%'.$value_one.'%'];
                break;
            case '*=':
            case '*!=':
                $operator = (stripos($operator, '!') !== false) ? 'not ' : '';
                $operator .= 'like';
                $arguments = [$operator, '%'.$value_one];
                break;
            case '=*':
            case '!=*':
                $operator = (stripos($operator, '!') !== false) ? 'not ' : '';
                $operator .= 'like';
                $arguments = [$operator, $value_one.'%'];
                break;
            case 'EMPTY':
                $method = 'whereRaw';
                $arguments = "%s = ''";
                break;
            case 'NOT_EMPTY':
                $method = 'whereRaw';
                $arguments = "%s != ''";
                break;
            case 'IN':
                $method = 'whereIn';
                $arguments = [static::getListFromString($value_one)];
                break;
            case 'NOT_IN':
                $method = 'whereNotIn';
                $arguments = [static::getListFromString($value_one)];
                break;
            case 'NULL':
                $method = 'whereNull';
                break;
            case 'NOT_NULL':
                $method = 'whereNotNull';
                break;
        }

        return [
            'operator'  => $operator,
            'method'    => $method,
            'arguments' => $arguments,
            'value_one' => $value_one,
            'value_two' => $value_two,
            'settings'  => $settings,
            'positive'  => $positive,
        ];
    }
569293
protected function setRequestQueryString()
    {
        $query = $this->request->getQuery();

        foreach ($this->queryStrings as $key => $value) {
            $query->set($key, $value);
        }
    }
95257
public function filter($value)
    {
        foreach($this->getFilters() as $index => $filter) {
            // Extract the params
            list($method, $params) = $filter;

            // If method is null, we use the index as the method name
            $method = is_null($method) ? $index : $method;

            // Build the params for the filter
            array_unshift($params, $value);

            // If it's a anonymous function
            if (!is_string($method) && is_callable($method)) {

                $value = call_user_func_array($method, $params);

                // if it's a local method
            } else {

                if (!method_exists($this, $method)) {
                    throw new \Exception('Method "'. $method .'" not found for filter : ' . $index);
                }

                $value = call_user_func_array([$this, $method], $params);
            }
        }

        return $value;
    }
563909
public function filter($value)
    {
        $valueCopy = (string)$value;

        // If comments are allowed, then replace them with unique identifiers
        if ($this->getCommentsAllowed()) {
            preg_match_all('/<\!--.*?--\s*>/s', (string)$valueCopy, $matches);
            $comments = array_unique($matches[0]);
            foreach ($comments as $k => $v) {
                $valueCopy = str_replace($v, self::UNIQUE_ID_PREFIX . $k, $valueCopy);
            }
        }

        // Initialize accumulator for filtered data
        $dataFiltered = '';
        // Parse the input data iteratively as regular pre-tag text followed by a
        // tag; either may be empty strings
        preg_match_all('/([^<]*)(<?[^>]*>?)/', (string)$valueCopy, $matches);
        // Iterate over each set of matches
        foreach ($matches[1] as $index => $preTag) {
            // If the pre-tag text is non-empty, strip any ">" characters from it
            if (strlen($preTag)) {
                $preTag = str_replace('>', '', $preTag);
            }
            // If a tag exists in this match, then filter the tag
            $tag = $matches[2][$index];
            if (strlen($tag)) {
                $tagFiltered = $this->_filterTag($tag);
            } else {
                $tagFiltered = '';
            }
            // Add the filtered pre-tag text and filtered tag to the data buffer
            $dataFiltered .= $preTag . $tagFiltered;
        }

        // If comments are allowed, then replace the unique identifiers with the corresponding comments
        if ($this->getCommentsAllowed()) {
            foreach ($comments as $k => $v) {
                $dataFiltered = str_replace(self::UNIQUE_ID_PREFIX . $k, $v, $dataFiltered);
            }
        }

        // Return the filtered data
        return $dataFiltered;
    }
600065
public function filter($condition)
    {
        $items = $this->find()->where($condition)->all();
        $this->_filter = $this->_getTreeNodesIds($items);
    }
924001
public function filter($values)
    {
        if (is_array($values)) {
            foreach ($values as $key => $value) {
                $values[$key] = $this->filterValue($value);
            }
        }

        return $values;
    }
370839
protected function filterNull()
    {
        $vars = $this->toArray();
        foreach ($vars as $name => $value) {
            if (is_null($value)) {
                unset($this->{$name});
            }
        }
    }
947296
public function filter($value)
    {
        return true === array_key_exists((string)$value, $this->translations) ? $this->translations[$value] : null;
    }
1054467
public function filter()
    {
        $this->preFilter();
        $this->orderBy();
        foreach( self::$filters as $filter ) {
            $filter( $this->builder, $this->request );
        }
    }
253849
private function check($value) {

		if(true === is_string($value)) {
			return false !== filter_var(trim($value), \FILTER_VALIDATE_EMAIL);
		}

		return false;
	}
28057
private function filter(string $value) : string
    {
        foreach ($this->filters as $filter) {
            $value = $filter($value);
        }

        return $value;
    }
283952
public function filter($value)
    {
        $type = $this->getType();

        // FLOAT (0.0)
        if ($type >= self::TYPE_FLOAT) {
            $type -= self::TYPE_FLOAT;
            if (is_float($value) && ($value == 0.0)) {
                return;
            }
        }

        // STRING ZERO ('0')
        if ($type >= self::TYPE_ZERO_STRING) {
            $type -= self::TYPE_ZERO_STRING;
            if (is_string($value) && ($value == '0')) {
                return;
            }
        }

        // STRING ('')
        if ($type >= self::TYPE_STRING) {
            $type -= self::TYPE_STRING;
            if (is_string($value) && ($value == '')) {
                return;
            }
        }

        // EMPTY_ARRAY (array())
        if ($type >= self::TYPE_EMPTY_ARRAY) {
            $type -= self::TYPE_EMPTY_ARRAY;
            if (is_array($value) && ($value == [])) {
                return;
            }
        }

        // INTEGER (0)
        if ($type >= self::TYPE_INTEGER) {
            $type -= self::TYPE_INTEGER;
            if (is_int($value) && ($value == 0)) {
                return;
            }
        }

        // BOOLEAN (false)
        if ($type >= self::TYPE_BOOLEAN) {
            $type -= self::TYPE_BOOLEAN;
            if (is_bool($value) && ($value == false)) {
                return;
            }
        }

        return $value;
    }
856769
private static function string()
    {
        $files = ['Strings'];
        $folder = static::$root.'Strings'.'/';

        self::call($files, $folder);

        $files = ['StringOutIndexException'];
        $folder = static::$root.'Strings/Exceptions'.'/';

        self::call($files, $folder);
    }
630888
public function filter($value)
    {
        if (!is_string($value)) {
            return $value;
        }
        $value = (string) $value;

        if (null === $this->options['charlist']) {
            return $this->unicodeTrim($value);
        }

        return $this->unicodeTrim($value, $this->options['charlist']);
    }
1259681
public function filter()
    {
        $blueprints = $this->blueprints();
        $values = $blueprints->filter($this->toArray());
        if ($values && isset($values['header'])) {
            $this->header($values['header']);
        }
    }
63341
public function filter($string, $method = null)
	{
		// Pick default method when none passed
		$method = $method ?: $this->defaultMethod;

		// Check if method is callable
		if (!is_callable(array($this->jClass, $method), false, $callable_name))
		{
			throw new \UnexpectedValueException(sprintf('Unable to execute method %s of %s.', $method, $this->getName()));
		}

		// Retrieve overloaded arguments without method
		$arguments = func_get_args();
		unset ($arguments[1]);

		// Execute
		return call_user_func_array(array($this->jClass, $method), $arguments);
	}
1034488
public function filterByValueLike($value)
    {
        $callback = function (BindingInterface $binding, $key) use ($value) {
            return strpos($binding->getValue(), $value) !== false;
        };

        return $this->filter($callback);
    }