Validate params against given expressions.

@param $params

@return bool
330607
protected function matchFilters($params)
    {
        foreach ($this->filters as $key => $expression) {
            if (!isset($params[$key])) {
                return false;
            }

            if (!preg_match($expression, $params[$key])) {
                return false;
            }
        }

        return true;
    }
904497
public function validate(...$params)
    {
        list($name, $value, $validValues, $throws, $template) = $params;

        return ValidatorHelper::validateEnum($name, $value, $validValues, $throws, $template);
    }
457361
private function formatParams(array $params) {
        foreach ($params as $key => $value) {
            if (is_array($value)) {
                $params[$key] = implode(',', $value);
            } else if (is_bool($value)) {
                $params[$key] = $value ? 1 : 0;
            }
        }
        return $params;
    }
390201
private function check($value, $params) {

		if(true === is_string($value)) {

			if('' === trim($value) && intval($params[0]) === 0) {
				return true;
			}
			
			return count(explode(' ', trim($value))) <= intval($params[0]);
		}

		return false;
	}
242985
private function filterMatchedParams(&$params)
    {
        $i = 0;
        while (true) {
            if (!isset($params[$i])) {
                break;
            }
            unset($params[$i]);
            $i++;
        }

        foreach ($params as $k => $param) {
            if ($param === '') {
                unset($params[$k]);
            }
        }
    }
690804
private function filterParameters(array $params): array
    {
        return
            array_filter(
                $params,
                function (&$value) {
                    if (is_array($value)) {
                        $value = $this->filterParameters($value);

                        return count($value) > 0;
                    } else {
                        return !is_null($value);
                    }
                }
            );
    }
1154915
protected function validExpressions(array $expressions = [])
    {
        foreach ($expressions as $expression) {
            if (!$expression instanceof AbstractExpression) {
                $errMsg = 'Некорректная коллекция объектов запросов в workflow';
                throw new InvalidArgumentException($errMsg);
            }
        }
    }
255192
private function check($value, $params) {

		if(true === is_string($value) || is_numeric($value)) {
			return strlen($value) >= (int) $params[0];
		}

		return false;
	}
1251824
private static function validateParams($name, $params, array $others) {
        if (is_array($params)) {
            foreach ($params + $others as $key => $value) {
                if ($key === '' || $value === null) {
                    unset($params[$key]);
                    continue;
                }
                $params[$key] = self::validateString("{$name}[$key]", $value);
            }
            return $params;
        }
        if (false === $params = filter_var($params)) {
            throw new InvalidArgumentException("The value of $name must be a 1-demensional array or query string.");
        }
        $tmp = $others;
        if ('' !== $params = trim($params)) {
            foreach (explode('&', $params) as $pair) {
                list($key, $value) = explode('=', $pair, 2) + array(1 => '');
                $tmp[urldecode($key)] = urldecode($value);
            }
        }
        return $tmp;
    }
888304
protected function set_params( $params ) {
		$this->requirements_details_url = ! empty( $params['requirements_details_url'] ) ? esc_url( trim( (string) $params['requirements_details_url'] ) ) : $this->requirements_details_url;
		$this->version_compare_operator = ! empty( $params['version_compare_operator'] ) ? (string) $params['version_compare_operator'] : $this->version_compare_operator;
		$this->not_valid_actions        = ! empty( $params['not_valid_actions'] ) ? (array) $params['not_valid_actions'] : $this->not_valid_actions;
		$this->show_valid_results       = isset( $params['show_valid_results'] ) ? (bool) $params['show_valid_results'] : $this->show_valid_results;
	}
970526
public function verifyHash(array $params)
    {
        $result = false;
        try {
            $this->sdk->CheckOutFeedback($params);
            $result = true;
        } catch (Exception $e) {
        }

        return $result;
    }
656264
protected function _validateParams(array $params) {
        $config = new Garp_Util_Configuration($params);
        $config->obligate('to');
        $config->obligate('subject');

        if (!isset($params['message']) && !isset($params['htmlMessage'])) {
            throw new Garp_Util_Configuration_Exception(
                sprintf(
                    Garp_Util_Configuration::EXCEPTION_MISSINGKEY,
                    'message OR htmlMessage'
                )
            );
        }
    }
1134407
protected function validateSubset($field, $value, $params)
    {
        if (!isset($params[0])) {
            return false;
        }
        if (!\is_array($params[0])) {
            $params[0] = [$params[0]];
        }
        if (\is_scalar($value)) {
            return $this->validateIn($field, $value, $params);
        }
        $intersect = \array_intersect($value, $params[0]);

        return \array_diff($value, $intersect) === \array_diff($intersect, $value);
    }
1215613
private function _validateParameters ($params)
    {
        // 引数の有無
        if (! isset($params[0])) {
            throw new \Exception('生成するコマンド名を指定してください');
        }

        // 既に存在するかどうか
        $params[0] = ucfirst($params[0]);
        if (file_exists(GARNET.DS.'Command'.DS.$params[0].'.php')) {
            throw new \Exception($params[0].' コマンドは既に存在しています');
        }
    }
305396
protected function prepareParams(array $params)
	{
		$prepared = [];
		
		foreach($params as $k => $v)
		{
			if(is_array($v))
			{
				foreach(array_values($v) as $i => $val)
				{
					$prepared[sprintf('%s%u', $k, $i)] = $val;
				}
			}
			else
			{
				$prepared[(string)$k] = $v;
			}
		}
		
		return $prepared;
	}
314805
public function validate($args)
    {
        $check = $this->normalizeArgs(is_array($args) ? $args : []);

        return is_array($check) ? true : $check;
    }
94638
private function check($value, $params) {

		if(true === is_string($value)) {
			return true === in_array($value, $params[0]);
		}

		return false;
	}