@param string $value
@param string $parameter

@return null|string
171456
protected function _validate_ext($value, $parameter)
    {
        if ($value === '') {
            return '';
        }

        $ext = pathinfo($value, PATHINFO_EXTENSION);
        return in_array(strtolower($ext), preg_split('#[\s,]+#', $parameter, -1, PREG_SPLIT_NO_EMPTY), true) ? $value : null;
    }
953589
protected function getValueFromParameterString($name, $paramString, $value)
    {
        $original = $paramString;

        while (preg_match('@^(\[([^\]]+)\])@', $paramString, $matches)) {
            $key = $matches[2];
            $paramString = str_replace($matches[1], '', $paramString);

            if (!isset($value[$key])) {
                throw new Exception\ParameterKeyDoesNotExistException($name, $original);
            }

            $value = $value[$key];

            if (empty($paramString)) {
                break;
            }
        }

        return $value;
    }
933940
protected function _validate_exists($value, $parameter = null)
    {
        $context = $this->_context;

        if (!$value) {
            return $value;
        }
        $field = $context->field;
        if ($parameter) {
            $className = $parameter;
        } else {
            $modelName = get_class($context->model);
            if (preg_match('#^(.*)_id$#', $field, $match)) {
                $className = substr($modelName, 0, strrpos($modelName, '\\') + 1) . Text::camelize($match[1]);
                if (!class_exists($className)) {
                    $className = $this->alias->get('@ns.app') . '\\Models\\' . Text::camelize($match[1]);
                }
            } else {
                throw new InvalidValueException(['validate `:field` field failed: related model class name is not provided', 'field' => $field]);
            }
        }

        if (!class_exists($className)) {
            throw new InvalidValueException(['validate `:1` field failed: related `:2` model class is not exists.', $field, $className]);
        }

        /**
         * @var \ManaPHP\Model $model
         * @var \ManaPHP\Model $className
         */
        $model = new $className;
        return $className::exists([$model->getPrimaryKey() => $value]) ? $value : null;
    }
950538
public function value($value)
    {
        if (is_null($value)) $value = '';
        $this->value = (string)$value;
        return $this;
    }
614083
public function setParameter($parameter, $value)
    {
        if (is_bool($value)) {
            $value = $value ? '1' : '0';
        }

        $this->parameters[$parameter] = $value;
    }
1035534
public function name($value = null)
    {
        if (func_num_args()) {
            $this->name = $value;
            return $this;
        }
        return $this->name;
    }
1090320
public function value($value = NULL) {
        if($value == NULL) {
            return false;
        }
        
        $o = explode('.',$value);
        $data = $this->request->data;
        return $data[$o[0]][$o[1]][$o[2]];
    }
131094
protected function _validate_min($value, $parameters)
    {
        /** @noinspection CallableParameterUseCaseInTypeContextInspection */
        $value = $this->_validate_float($value);

        return $value === null || $value < $parameters[0] ? null : $value;
    }
928126
protected function _validate_range($value, $parameters)
    {
        /** @noinspection CallableParameterUseCaseInTypeContextInspection */
        $value = $this->_validate_float($value);

        return $value === null || $value < $parameters[0] || $value > $parameters[1] ? null : $value;
    }
370922
public function getParameter($parameter) {
        $value = NULL;
        if ($parameter != NULL) {
            if (isset($this->params[$parameter])) {
                $value = $this->params[$parameter];
            }
        }
        if (is_null($value)) {
            if (isset($_POST[$parameter])) {
                $value = $_POST[$parameter];
            }
        }
        if (is_null($value)) {
            if (isset($_GET[$parameter])) {
                $value = $_GET[$parameter];
            }
        }
        if (is_string($value)) {
            $value = urldecode($value);
        }
        return $value;
    }
702045
public function get($parameter = null) {

        if ( empty($parameter) ) {

            $return = $this->parameters;

        } else if ( array_key_exists($parameter, $this->parameters) ) {

            $return = $this->parameters[$parameter];

        } else {

            $return = null;

        }

        return $return;

    }
52740
public function getValueBy(ParameterInterface $parameter)
    {
        if ($this->isExistBy($parameter) === false) {
            throw new NoBindParameterException('No parameter: ' . (string) $parameter);
        }

        return $this->parameters[$parameter->getHash()];
    }
372394
public function Protocol($Value = NULL) {
      if (!is_null($Value) && in_array($Value, array('http', 'https')))
         $this->_Protocol = $Value;
         
      return $this->_Protocol;
   }
801201
public function addParameter($parameter, $value)
    {
        if (isset($this->parameters[$parameter])) {
            return;
        }

        $this->parameters[$parameter] = $value;
    }
934193
public static function toRavelryPostFile($value, Parameter $parameter)
    {
        if (is_string($value)) {
            $value = fopen($value, 'r');
        }

        if (!($value instanceof StreamInterface)) {
            $value = \GuzzleHttp\Stream\create($value);
        }

        if ($value instanceof MetadataStreamInterface) {
            $filename = $value->getMetadata('uri');
        }

        if (!$filename || substr($filename, 0, 6) === 'php://') {
            $filename = $parameter->getWireName();
        }

        return new PostFile(
            $parameter->getWireName(),
            $value,
            $filename,
            [
                'Content-Disposition' => sprintf(
                    'form-data; name="%s"; filename="%s"',
                    $parameter->getWireName(),
                    basename($filename)
                ),
            ]
        );
    }
721765
protected function validateIs($value, string $parameter, array $args = [], array $rules = null, array $context = null): ?string
    {
        if (count($args) == 0) {
            throw new ValidatorConfigException("Validator 'is' must have argument in validator list for parameter {$parameter}");
        }

        //$value = $this->getValue($parameter);

        if ($value === null) {
            return null;
        }

        if (!is_scalar($value)) {
            return Message::getMessage(Message::PRIMITIVE, [
                'param' => $parameter
            ]);
        }

        $value = trim((string)$value);

        if ($value === '') {
            return null;
        }

        if ($value !== $args[0]) {
            return Message::getMessage(Message::IS, [
                'param' => $parameter,
                'value' => $value
            ]);
        }

        return null;
    }
1036365
protected function _validate_range($value, $parameter)
    {
        if (preg_match('#^(-?[\.\d]+)-(-?[\d\.]+)$#', $parameter, $match)) {
            return $value >= $match[1] && $value <= $match[2] ? $value : null;
        } else {
            throw new InvalidValueException(['range validator `:parameter` parameters is not {min}-{max} format', 'parameter' => $parameter]);
        }
    }