Creates a connection parameters instance from the supplied argument.

@param mixed $parameters Original connection parameters.

@return ParametersInterface
432115
protected function createParameters($parameters)
    {
        if (is_string($parameters)) {
            $parameters = Parameters::parse($parameters);
        } else {
            $parameters = $parameters ?: array();
        }

        if ($this->defaults) {
            $parameters += $this->defaults;
        }

        return new Parameters($parameters);
    }
370670
private function buildRequestParameters($parameters)
    {
        if (NULL === $parameters || empty($parameters)) {
            return null;
        }

        if (is_string($parameters)) {
            return $parameters;
        }

        $paramOut = '';
        foreach ($parameters as $key=>$value) {
            $paramOut .= $key.'=';
            if (is_array($value)){
                $paramOut .= join(',', $value);
            }else{
                $paramOut .= $value;
            }
            $paramOut .= '&';
        }

        return $paramOut;
    }
1340309
protected function prepareParameters(array $parameters)
	{
		return array_merge($this->_parameters, self::resolveAliases($parameters, $this->aliases));
	}
18040
protected function getConnectionAndTable($parameters)
    {
        $parts = explode('.', $this->getParameter($parameters, 0));

        $connection = isset($parts[1])
            ? $parts[0]
            : Config::get('database.default');

        $table = $parts[1] ?? $parts[0];

        return [$connection, $table];
    }
1240021
protected function constructActionUrl(array $parameters = array())
    {
        switch($this->uriBuildMethod) {
            case self::PLAIN_URL_BUILD_METHOD;
                return $this->baseUrl;
                break;
            case self::ADDS_ON_URL_BUILD_METHOD;
                return $this->replaceAddsOn($this->baseUrl, $parameters);
                break;
            default;
                throw new Exception\BadConfiguredActionException(
                    sprintf('Unknown url build method: %s', $this->uriBuildMethod),
                    $this
                );
                break;
        }
    }
194605
public function removeParameters(array $parameters = null)
  {
    $this->parameters = array();

    if ($parameters) {
      $this->addParameters($parameters);
    }

    return $this;
  }
1300441
private function resolveParameters($parameters): array
    {
        // this will hold our dependencies information
        $dependencies = [];

        // Then loop through the parameters to see what is in the constructor.
        foreach ($parameters as $key => $parameter) {
            // Extract the class name to a dependency.
            $dependency = $parameter->getClass();

            // If it is null, then it is not a class, so we need to see if we've been
            // given a default value. If so, store the value for now.
            if (is_null($dependency)) {
                if ($parameter->isDefaultValueAvailable()) {
                    $dependencies[$key]['type'] = 'default';
                    $dependencies[$key]['value'] = $parameter->getDefaultValue();
                } else {
                    throw new ContainerException('Non class dependency ('.$parameter->name.') requires default value.');
                }
            }
            // Otherwise, it's a class dependency. We will store the class name
            // so that we can create it later.
            else {
                $dependencies[$key]['type'] = 'class';
                $dependencies[$key]['value'] = $dependency->name;
            }
        }

        return $dependencies;
    }
261700
public function withParameters(array $parameters): self
    {
        $this->parameters = [];
        foreach ($parameters as $name => $value) {
            $this->withParameter($name, $value);
        }

        return $this;
    }
764579
public function create($parameters)
    {
        $this->checkParameters(CloudItemInterface::TYPE_FILE, FileInterface::REQUIRED_PARAMETERS, (array) $parameters);

        $file = new File();
        $file->setName($parameters['name'])
            ->setSize((int) $parameters['size'])
            ->setParentFolder($parameters['parentFolder'])
            ->setId($parameters['id'])
            ->setProvider($parameters['provider'])
        ;

        return $file;
    }
1215180
public function getRelativeUrl(array $parameters = array())
    {
        $route = $this->request->attributes->get('_route');

        $parameters = array_merge($this->getParameters(), $parameters);

        return $this->router->generate($route, $parameters);
    }
950215
public function getParameters(array $parameters = [])
    {
        foreach (['view', 'this'] as $forbiddenKey) {
            if (array_key_exists($forbiddenKey, $parameters)) {
                throw new \ErrorException('The "' . $forbiddenKey . '" key is forbidden.');
            }
        }
        $sharedVariables = $this->getOptionDefault('shared_variables');
        if ($sharedVariables) {
            $parameters = array_merge($sharedVariables, $parameters);
        }
        $parameters['view'] = $this;

        return $parameters;
    }
1098853
protected function createConnection($params)
    {
        $credentials = '';
        if (isset($params['password'])) {
            $credentials = ':' . $params['password'];
        }
        if (isset($params['user'])) {
            $credentials = $params['user'] . $credentials . '@';
        }

        $database = '';
        if (isset($params['dbname'])) {
            $database = '/' . $params['dbname'];
        }

        $server = sprintf(
            'mongodb://%s%s:%s%s',
            $credentials,
            (isset($params['host']) ? $params['host'] : 'localhost'),
            (isset($params['port']) ? $params['port'] : '27017'),
            $database
        );

        $options = [];
        if (!empty($params['options'])) {
            $options = $params['options'];
        }

        return new Connection($server, $options);
    }
1164454
protected static function getAddress(ParametersInterface $parameters)
    {
        if (filter_var($host = $parameters->host, FILTER_VALIDATE_IP)) {
            return $host;
        }

        if ($host === $address = gethostbyname($host)) {
            return false;
        }

        return $address;
    }
970249
protected function getParameters(array $parameters)
    {
        return empty($parameters) ? $this->parameters : array_merge($this->parameters, $parameters);
    }
1150575
private function buildParametersString($parameters)
    {
        $parts = [];

        ksort($parameters);
        foreach ($parameters as $key => $val) {
            $parts[] = sprintf('%s=%s', $key, $val);
        }

        return implode('; ', $parts);
    }
1239889
public function make($abstract, $parameters = array())
        {
            $abstract = $this->getAlias($abstract);

            // If an instance of the type is currently being managed as a singleton we'll
            // just return an existing instance instead of instantiating new instances
            // so the developer can keep using the same objects instance every time.
            if (Arrays::exists($abstract, $this->instances)) {
                return $this->instances[$abstract];
            }
            $concrete = $this->getConcrete($abstract);

            // We're ready to instantiate an instance of the concrete type registered for
            // the binding. This will instantiate the types, as well as resolve any of
            // its "nested" dependencies recursively until all have gotten resolved.
            if ($this->isBuildable($concrete, $abstract)) {
                $object = $this->build($concrete, $parameters);
            } else {
                $object = $this->make($concrete);
            }

            // If the requested type is registered as a singleton we'll want to cache off
            // the instances in "memory" so we can return it later without creating an
            // entirely new instance of an object on each subsequent request for it.
            if ($this->isShared($abstract)) {
                $this->instances[$abstract] = $object;
            }

            return $object;
        }
602858
protected function createParametersBody(array $parameters)
    {
        foreach ($parameters as $name => $parameter) {
            if (is_bool($parameter)) {
                $parameters[$name] = $parameter ? 'true' : 'false';
            } elseif (is_array($parameter)) {
                foreach ($parameter as $subName => $subParameter) {
                    if (is_bool($subParameter)) {
                        $subParameter = $subParameter ? 'true' : 'false';
                    }
                    $parameters[$name.'/'.$subName] = $subParameter;
                }
                unset($parameters[$name]);
            } elseif ($parameter instanceof DateTime) {
                $parameters[$name] = $parameter->format($parameter::ATOM);
            }
        }

        return $parameters;
    }