Returns an array with value and column name for an optional ignore.
Shaves of the ignore_id from the end of the array, if there is one.

@param  array $parameters
@return array [$ignoreId, $ignoreColumn]
190454
private function getIgnore(&$parameters) {
        $lastParam = end($parameters);
        $lastParam = array_map('trim', explode('=', $lastParam));

        // An ignore_id is only specified if the last param starts with a
        // number greater than 1 (a valid id in the database)
        if (!preg_match('/^[1-9][0-9]*$/', $lastParam[0])) {
            return array(null, null);
        }

        $ignoreId = $lastParam[0];
        $ignoreColumn = (sizeof($lastParam) > 1) ? end($lastParam) : null;

        // Shave of the ignore_id from the array for later processing
        array_pop($parameters);

        return array($ignoreId, $ignoreColumn);
    }
107160
protected function parseValues(array $parameters)
    {
        $signable = [];

        foreach ($parameters as $key => &$parameter) {

            // JSON an array value
            $parameter = $this->arrayToJson($parameter);

            // Append a secret to the present webhooks
            $parameter = $this->appendSecretToWebhook($key, $parameter);

            // Put the value string to the signable data
            $signable[] = $key . '=' . (string)$parameter;
        }

        $signable = implode('&', $signable);

        return compact('parameters', 'signable');
    }
630451
public static function listAllVariantsAsync(array $parameters = [])
    {
        return self::listAllVariantsAsyncWithHttpInfo($page, $size, $sort)
            ->then(
                function ($response) {
                    return $response[0];
                }
            );
    }
487489
final public function getQuery(array $parameters = [])
    {
        $parameters = $this->getOptionsResolver()->resolve($parameters);
        $query = $this->buildQuery();

        $sortDefinitions = $parameters['sort'];
        if (!is_array($sortDefinitions)) {
            $sortDefinitions = [$sortDefinitions];
        }

        $query->query = $this->getQueryCriterion($parameters);
        $query->filter = $this->resolveFilterCriteria($parameters);
        $query->facetBuilders = $this->getFacetBuilders($parameters);
        $query->sortClauses = $this->getSortClauses($sortDefinitions);
        $query->limit = $parameters['limit'];
        $query->offset = $parameters['offset'];

        return $query;
    }
746910
protected function prepareParameters(array $parameters = [])
    {
        foreach ($parameters as &$parameterValue) {
            if (is_bool($parameterValue)) {
                $parameterValue = (int) $parameterValue;
            } elseif ($parameterValue instanceof \DateTimeInterface) {
                $parameterValue = $parameterValue->format('Y-m-d H:i:s');
            } elseif (!is_scalar($parameterValue) && $parameterValue !== null) {
                throw new \InvalidArgumentException(
                    sprintf('Invalid db parameter type "%s"', gettype($parameterValue))
                );
            }
        }
        unset($parameterValue);

        return $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;
    }
1277249
public function missingMethod($parameters = array())
    {

        if (is_array($parameters)) {
            $parameters = implode('/', $parameters);
        }

        # If parameters is a file
        if ($file = $this->path($parameters)) {
            $response = \with(new AssetCollection(array(
                new FileAsset($file)
            )))->dump();
        } elseif ($aParameters = json_decode($parameters, TRUE)) {

            array_walk($aParameters, function (&$item) {
                $item = new FileAsset($this->path($item));
            });

            $response = \with(new AssetCollection($aParameters))->dump();
        }

        if (isset($response)) {

            $headers = array();

            if (preg_match('/.css/i', $parameters)) {
                $headers['Content-Type'] = 'text/css';
            } elseif (preg_match('/.js/i', $parameters)) {
                $headers['Content-Type'] = 'text/javascript';
            } elseif (preg_match('/.html|.htm|.php/i', $parameters)) {
                $headers['Content-Type'] = 'text/html';
            } else {
                $file = new File($file);
                $mime = $file->getMimeType();
                if ($mime) {
                    $headers['Content-Type'] = $mime;
                } else {
                    $headers['Content-Type'] = 'text/html';
                }
            }

            return Response::make($response, 200, $headers);
        }

        return Response::make('', 404);
    }
681210
protected function implicitGetScope(array $parameters): ?array
    {
        $scope = $this->implicitReadStringValue($parameters, 'scope');

        return empty($scope) === false ? explode(' ', $scope) : null;
    }
616600
public function getProviderParameters(array $parameters)
    {
        if (isset($parameters['type'])) {
            unset($parameters['type']);
        }

        if (isset($parameters['aliases'])) {
            unset($parameters['aliases']);
        }

        if (isset($parameters['namespace'])) {
            unset($parameters['namespace']);
        }

        return $parameters;
    }
458320
private function parseArrayParameter(array $parameter)
    {
        return "\n" . $this->formatter->arrayToKeyValueList(
            array_map(
                function ($item) {
                    return print_r($item, true);
                },
                $parameter
            )
        );
    }
768969
protected function replaceDefaults(array $parameters)
	{
		foreach ($parameters as $key => &$value)
		{
			$value = isset($value) ? $value : array_get($this->defaults, $key);
		}

		return $parameters;
	}
536227
private function parametersToData(array $parameters)
    {
        $data = array();

        foreach ($parameters as $parameter) {
            $data[$parameter->getName()] = $this->parameterToData($parameter);
        }

        return (object) $data;
    }
1014680
protected function _getShortNames($parameters)
    {
        $shortNames = [];
        foreach ($parameters as $parameter) {
            $rc = $parameter->getClass();
            if ($rc && is_subclass_of($rc->getName(), Component::class)) {
                continue;
            }

            $name = $parameter->getName();
            $short = $name[0];
            if (isset($names[$short])) {
                $shortNames[$short] = false;
            } else {
                $shortNames[$short] = $name;
            }
        }
        return array_flip(array_filter($shortNames));
    }
420696
public function unmap(array $params)
	{
		if (!isset($params['ientifier'])) {
			throw new MissingArgumentException('identifier');
		}

		if (!isset($params['all_identifiers'])) {
			throw new MissingArgumentException('all_identifiers');
		}

		if (!isset($params['primaryKey'])) {
			throw new MissingArgumentException('primaryKey');
		}

		if (!isset($params['unlink'])) {
			throw new MissingArgumentException('unlink');
		}

		if (!isset($params['format'])) {
			$params['format'] = 'json';
		}

		return $this->post('unmap', $params);
	}
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;
    }
667800
private function parameterBuilder($parameters)
    {
        foreach (get_object_vars($this) as $variable => $value)
        {
            // Except these variables
            if (!in_array($variable, $this->exceptions))
            {
                // Assuming it's not null
                if ($value !== null)
                {
                    // Converts boolean to string
                    if (is_bool($value))
                    {
                        $value = $value ? 'true' : 'false';
                    }

                    switch ($variable)
                    {
                        // Allows LatLng to be passed as an array
                        case 'location':
                            if (is_array($value))
                            {
                                // Just in case it's an associative array
                                $value = array_values($value);
                                $value = $value[0] . ',' . $value[1];
                            }
                            break;

                        // Checks that it's a value rank by value
                        case 'rankby':
                            $value = strtolower($value);

                            if (!in_array($value, array('prominence', 'distance')))
                            {
                                throw new \Exception('Invalid rank by value, please specify either "prominence" or "distance".');
                            }
                            break;

                        // Allows types to be passed as an array
                        case 'types':
                            if (is_array($value))
                            {
                                $value = implode('|', $value);
                            }
                            break;
                    }

                    $parameters[$variable] = $value;
                }
            }
        }
        return $parameters;
    }
71204
public function getMissingParameterKey(array $parameters, array $requiredKeys = [])
    {
        foreach ($requiredKeys as $key) {
            if (! isset($parameters[$key])) {
                return $key;
            }
        }
    }