@param EncodingParametersInterface|null $parameters

@return int|null
422522
protected function getPageNumber(EncodingParametersInterface $parameters)
    {
        $paging = $parameters->getPaginationParameters();
        return isset($paging[self::PARAM_PAGING_NUMBER]) ? $paging[self::PARAM_PAGING_NUMBER] : null;
    }
508997
static protected function encodeXmlParameter( $parameter ){
		switch( gettype( $parameter ) ){
			case 'object':
				foreach( get_object_vars( $parameter ) as $key => $value ){
					$value	= self::encodeXmlParameter( $value );
					$data[]	= '<member><name>'.$key.'</name>'.$value.'</member>';
				}
				return '<struct>'.join( $data ).'</struct>';
			case 'array':
				$data	= array();
				foreach( $parameter as $value )
					$data[]	= self::encodeXmlParameter( $value );	
				return '<array><data>'.join( $data ).'</data></array>';
			case 'int':
			case 'integer':
				return '<value><int>'.$parameter.'</int></value>';
			case 'bool':
			case 'boolean':
				return '<value><boolean>'.( (int) $parameter ).'</boolean></value>';
			case 'double':
			case 'float':
				return '<value><double>'.$parameter.'</double></value>';
			case 'string':
				return '<value><string>'.$parameter.'</string></value>';
		}
	}
1146161
private function calculateStringToSignV2(array $parameters)
    {
        $data = 'POST';
        $data .= "\n";
        $data .= $this->mwsEndpointUrl;
        $data .= "\n";
        $data .= $this->mwsEndpointPath;
        $data .= "\n";
        $data .= $this->getParametersAsString($parameters);

        $this->logMessage($this->sanitizeRequestData($data));

        return $data;
    }
817456
public function printParameters($parameters)
    {
        $length = 0;
        foreach ($parameters as $parameter => $description) {
            if ($length == 0) {
                $length = strlen($parameter);
            }
            if (strlen($parameter) > $length) {
                $length = strlen($parameter);
            }
        }

        print Color::head('Options:') . PHP_EOL;
        foreach ($parameters as $parameter => $description) {
            print Color::colorize(' --' . $parameter . str_repeat(' ', $length - strlen($parameter)), Color::FG_GREEN);
            print Color::colorize("    " . $description) . PHP_EOL;
        }
    }
522366
public function execute($parameters = null)
    {
        if ($parameters !== null) {
            $parameters = array_intersect_key($parameters, $this->types);
            foreach ($this->placeholders as $i => $name) {
                $value = & $parameters[$name];
                if ($value === null) {
                    $this->bindValue($i + 1, null, Connection::PARAM_NULL);
                } else {
                    $type = & $this->types[$name];
                    if ($type === Connection::PARAM_INT) {
                        $value = (int)$value;
                    } elseif ($type === Connection::PARAM_DATE_TIME) {
                        $value = $this->grammar->buildDateTime($value);
                        $type = Connection::PARAM_STR;
                    } elseif ($type === Connection::PARAM_TIME) {
                        $value = $this->grammar->buildTime($value);
                        $type = Connection::PARAM_STR;
                    }
                    $this->bindValue($i + 1, $value, $type);
                }
            }
        }
        parent::execute();

        return $this;
    }
232647
protected function tcpStreamInitializer(ParametersInterface $parameters)
    {
        if (!filter_var($parameters->host, FILTER_VALIDATE_IP, FILTER_FLAG_IPV6)) {
            $address = "tcp://$parameters->host:$parameters->port";
        } else {
            $address = "tcp://[$parameters->host]:$parameters->port";
        }

        $flags = STREAM_CLIENT_CONNECT;

        if (isset($parameters->async_connect) && $parameters->async_connect) {
            $flags |= STREAM_CLIENT_ASYNC_CONNECT;
        }

        if (isset($parameters->persistent)) {
            if (false !== $persistent = filter_var($parameters->persistent, FILTER_VALIDATE_BOOLEAN, FILTER_NULL_ON_FAILURE)) {
                $flags |= STREAM_CLIENT_PERSISTENT;

                if ($persistent === null) {
                    $address = "{$address}/{$parameters->persistent}";
                }
            }
        }

        $resource = $this->createStreamSocket($parameters, $address, $flags);

        return $resource;
    }
1280448
private function getArgumentByName(\ReflectionParameter $parameter, $parameters)
    {
        foreach ($parameters as $name => $item) {
            $paramName = $parameter->getName();
            if ($name === $paramName) {
                return $item;
            }
        }

        return null;
    }
686494
protected function encode($method, array $parameters = [])
    {
        $this->encoder = $this->encoder ?: new XmlrpcEncoder();

        return $this->encoder->encodeCall($method, $parameters);
    }
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;
    }
100160
public function validateParameters(&$parameters)
    {
        if (!isset($parameters['username']))
        {
            throw new InvalidArgumentException(
                'The \'username\' parameter must be defined for the Password grant type',
                InvalidArgumentException::MISSING_PARAMETER
            );
        }
        elseif (!isset($parameters['password']))
        {
            throw new InvalidArgumentException(
                'The \'password\' parameter must be defined for the Password grant type',
                InvalidArgumentException::MISSING_PARAMETER
            );
        }
    }
505432
public function indexPosts($userId, EncodingParametersInterface $parameters)
    {
        $this->getLogger()->debug('Index user posts started.', [User::FIELD_ID => $userId]);

        $result = $this->indexRelationship($userId, User::REL_POSTS, $parameters);

        $this->getLogger()->debug('Index user posts completed.');

        return $result;
    }
738935
protected function parametersToString(array $parameters)
    {
        $pieces = array();
        foreach ($parameters as $key => $val) {
            $pieces[] = sprintf('"%s": "%s"', $key, (is_string($val) ? $val : json_encode($val)));
        }

        return implode(', ', $pieces);
    }
1171658
public function setParameters($parameters) {
    $this->parameters = $parameters;
    // store version with colons stripped
    $this->parametersStripped = array_combine(array_map(function($name) {
        return preg_replace('/^:/', '', $name);
    }, array_keys($this->parameters)), $this->parameters);
  }
528006
protected function normalizeProtocolParameters(array $parameters)
    {
        array_walk($parameters, function (&$value, $key) {
            $value = rawurlencode($key).'="'.rawurlencode($value).'"';
        });

        return 'OAuth '.implode(', ', $parameters);
    }
1193010
public static function parseParameters(array $parameters)
    {
        //TODO: let 2nd parameter be both title, or default query parameters
        //TODO: needs some checks before determining $title
        $explodeResult    = self::explodeSortParameter($parameters[0]);
        $sortColumn       = (empty($explodeResult)) ? $parameters[0] : $explodeResult[1];
        $title            = (count($parameters) === 1) ? $sortColumn : $parameters[1];
        $queryParameters  = (isset($parameters[2]) && is_array($parameters[2])) ? $parameters[2] : [];
        $anchorAttributes = (isset($parameters[3]) && is_array($parameters[3])) ? $parameters[3] : [];

        return [$sortColumn, $parameters[0], $title, $queryParameters, $anchorAttributes];
    }
736852
public function encodeParameters($types, $params)
    {
        // change json to array
        if ($types instanceof stdClass && isset($types->inputs)) {
            $types = Utils::jsonToArray($types, 2);
        }
        if (is_array($types) && isset($types['inputs'])) {
            $inputTypes = $types;
            $types = [];

            foreach ($inputTypes['inputs'] as $input) {
                if (isset($input['type'])) {
                    $types[] = $input['type'];
                }
            }
        }
        if (count($types) !== count($params)) {
            throw new InvalidArgumentException('encodeParameters number of types must equal to number of params.');
        }
        $typesLength = count($types);
        $solidityTypes = $this->getSolidityTypes($types);
        $encodes = array_fill(0, $typesLength, '');

        foreach ($solidityTypes as $key => $type) {
            $encodes[$key] = call_user_func([$type, 'encode'], $params[$key], $types[$key]);
        }
        $dynamicOffset = 0;

        foreach ($solidityTypes as $key => $type) {
            $staticPartLength = $type->staticPartLength($types[$key]);
            $roundedStaticPartLength = floor(($staticPartLength + 31) / 32) * 32;

            if ($type->isDynamicType($types[$key]) || $type->isDynamicArray($types[$key])) {
                $dynamicOffset += 32;
            } else {
                $dynamicOffset += $roundedStaticPartLength;
            }
        }
        return '0x' . $this->encodeMultiWithOffset($types, $solidityTypes, $encodes, $dynamicOffset);
    }
41245
private byte[] encodeParameters(Map<String, String> params, String paramsEncoding) {
        StringBuilder encodedParams = new StringBuilder();
        try {
            for (Map.Entry<String, String> entry : params.entrySet()) {
                encodedParams.append(URLEncoder.encode(entry.getKey(), paramsEncoding));
                encodedParams.append('=');
                encodedParams.append(URLEncoder.encode(entry.getValue(), paramsEncoding));
                encodedParams.append('&');
            }
            return encodedParams.toString().getBytes(paramsEncoding);
        } catch (UnsupportedEncodingException uee) {
            throw new RuntimeException("Encoding not supported: " + paramsEncoding, uee);
        }
    }