Replace each field parameter which has asterisks with the given keys.

@param  array  $parameters
@param  array  $keys
@return array
552956
protected function replaceAsterisksInParameters(array $parameters, array $keys)
    {
        return array_map(function ($field) use ($keys) {
            return vsprintf(str_replace('*', '%s', $field), $keys);
        }, $parameters);
    }
18960
public function formatParameters(array $parameters, $keyString = null, $nested = false)
    {
        foreach ($parameters as $key => $value) {
            if (null !== $keyString && true === $nested) {
                $keyString = sprintf('%s[%s]', $keyString, $key);
            } else {
                $keyString = $key;
            }

            if (is_array($value)) {
                $this->formatParameters($value, $keyString, true);

                continue;
            } else {
                $this->formatedParameters[$keyString] = $value;
            }
        }

        return $this->formatedParameters;
    }
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);
  }
730655
protected function normalize(array $parameters)
    {
        foreach ($parameters as $parameter => $value) {
            if (null !== $this->knownParameters[$parameter]) {
                $parameters[$parameter] = sprintf($this->knownParameters[$parameter], $value);
            }
        }

        return $parameters;
    }
496644
private function _getParametersAsString(array $parameters)
    {
        $queryParameters = array();
        foreach ($parameters as $key => $value) {
            $queryParameters[] = $key . '=' . $this->_urlencode($value);
        }
        return implode('&', $queryParameters);
    }
707280
public function setParameters($parameters)
    {
        $this->parameters = [];
        
        foreach ($parameters as $parameter) {
            $this->append($parameter);
        }
        
        return $this;
    }
685589
protected function parseNamedParameters($parameters)
    {
        return array_reduce($parameters, function ($result, $item) {
            [$key, $value] = array_pad(explode('=', $item, 2), 2, null);

            $result[$key] = $value;

            return $result;
        });
    }
979744
public function withParameters(array $parameters): self
    {
        $query = $this;

        foreach ($parameters as $key => $parameter) {
            $query = $query->withParameter($key, $parameter);
        }

        return $query;
    }
47200
protected function replaceDefaults(array $parameters)
    {
        foreach ($parameters as $key => &$value) {
            if (! isset($value)) {
                $value = Arr::get($this->defaults, $key);
            }
        }

        return $parameters;
    }
456066
public static function replace($string, array $parameters)
    {
        $replacer = static function ($match) use ($parameters) {
            return $parameters[$match[1]] ?? $match[0];
        };

        return preg_replace_callback('/{{\s*(.+?)\s*}}/', $replacer, $string);
    }
437765
public function keyParametersByArgument(array $dependencies, array $parameters)
    {
        foreach ($parameters as $key => $value) {
            if (is_numeric($key)) {
                unset($parameters[$key]);
                $parameters[$dependencies[$key]->name] = $value;
            }
        }
        return $parameters;
    }
574334
protected function compileParameters(array $parameters)
    {
        return collect($parameters)->map(function ($value, $key)
        {
            if (is_numeric($key)) {
                return $value;
            }

            return $key .'=' .(is_numeric($value) ? $value : ProcessUtils::escapeArgument($value));

        })->implode(' ');
    }
344431
public function removeParameters(array $parameters = null)
  {
    if ($this->isLocked()) {
      return $this->getObj()->removeParameters($parameters)->setLocked();
    } else {
      return parent::removeParameters($parameters);
    }
  }
194605
public function removeParameters(array $parameters = null)
  {
    $this->parameters = array();

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

    return $this;
  }
197740
protected function _replaceParamsCallback($matches)
    {
        $key    = substr($matches[0], 1);
        $prefix = '';

        if(in_array($this->show, array('FULL TABLES', 'OPEN TABLES', 'TABLE STATUS', 'TABLES')) &&
            ($this->like && $key == 'like' || $this->where && ($key == 'name' || $key == 'table')))
        {
            $prefix = $this->getDriver()->getTablePrefix();
        }

        $replacement = $this->getDriver()->quoteValue($prefix.$this->_parameters[$key]);

        return is_array($this->_parameters[$key]) ? '('.$replacement.')' : $replacement;
    }
982810
protected function sort(array $parameters)
    {
        uksort(
            $parameters,
            function ($key1, $key2) {
                return strtolower($key1) > strtolower($key2) ? 1 : -1;
            }
        );

        return $parameters;
    }
1291788
private function normalizeParams($params)
    {
        $keys = array_keys($params);
        $values = array_values($params);

        $keys = array_map(function ($key) {
            return '{' . trim($key, '{}') . '}';
        }, $keys);

        $normalizedParams = array_combine($keys, $values);

        if (count($normalizedParams) !== count($params)) {
            throw new InvalidArgumentException('Identical params.');
        }

        return $normalizedParams;
    }