Flattens the given array.

@param  array  $parameters
@return array
775637
protected function flattenParameters(array $parameters)
	{
		$flattened = array();

		foreach($parameters as $parameter) {
			array_walk($parameter, function($value, $key) use (&$flattened) {
				$flattened[$key] = $value;
			});
		}

		return $flattened;
	}
775587
public function setUp($parameters)
    {
        $expressions = new ExpressionContainer();
        foreach ($parameters as $param) {
            $charType = $this->buildCharType($param);
            $expressions->set($charType);
        }

        return $expressions;
    }
1271933
public static function parameters(array $parameters)
    {
        $args = array();
        foreach ($parameters as $param) {
            $arg = '';

            if ($param->isPassedByReference()) {
                $arg .= '&';
            }

            $arg .= '$' . $param->getName();

            if ($param->isOptional()) {
                $arg .= ' = ';

                switch (true) {
                    case null === $param->getDefaultValue():
                        $arg .= 'null';
                        break;
                    case is_array($param->getDefaultValue()):
                        $arg .= 'array()';
                        break;
                    case is_bool($param->getDefaultValue()):
                        $arg .= $param->getDefaultValue() ? 'true' : 'false';
                        break;
                    case is_int($param->getDefaultValue()):
                        $arg .= $param->getDefaultValue();
                        break;
                    default:
                        $arg .= '\'' . str_replace('\'', '\\\'', $param->getDefaultValue()) . '\'';
                        break;
                }
            }

            $args[] = $arg;
        }

        return $args;
    }
609993
public function all(array $parameters = [])
    {
        $resolver = $this->createOptionsResolver();
        $resolver->setDefined('search');

        return $this->get('namespaces', $resolver->resolve($parameters));
    }
931384
public function transform(array $parameters)
    {
        $transformed = array();

        foreach ($parameters as $name => $value) {
            $transformed[$name] = $this->transformerResolver->resolve($value)->transform($value);
        }

        return $transformed;
    }
222597
public function setParameters(array $parameters)
    {
        $this->storage = new \ArrayObject();
        foreach ($parameters as $parameterName => $parameterValue) {
            $this->setParameter($parameterName, $parameterValue);
        }

        return $this;
    }
892682
public function mergeRequests(array $parameters = [])
    {
        $data = $this->client->mergeRequests()->all($this->id, $parameters);

        $mrs = array();
        foreach ($data as $mr) {
            $mrs[] = MergeRequest::fromArray($this->getClient(), $this, $mr);
        }

        return $mrs;
    }
1110967
public static function flatten($array = [])
    {
        $items = [];
        foreach ($array as $value) {
            if (is_array($value)) {
                $items = array_merge($items, self::flatten($value));
            } else {
                $items[] = $value;
            }
        }
        return $items;
    }
150675
public function with($parameters)
    {
        $this->parameters = array_merge($this->parameters, is_array($parameters) ? $parameters : func_get_args());

        return $this;
    }
1260326
public function getObjects(array $parameters = array())
    {
        $objects = array();

        foreach ($this->getObjectsInfo($parameters) as $record) {
            $objects[] = new Object($this, null, false, $record);
        }

        return $objects;
    }
768621
protected function replaceDefaults(array $parameters)
    {
        foreach ($parameters as $key => &$value) {
            $value = isset($value) ? $value : ArrayHelper::get($this->defaults, $key);
        }
        foreach ($this->defaults as $key => $value) {
            if (!isset($parameters[$key])) {
                $parameters[$key] = $value;
            }
        }

        return $parameters;
    }
331208
public function resolve(array $parameters) : array
    {
        if (!$number = $this->reflection->getNumberOfParameters()) {
            return [];
        }

        $arguments = \array_fill(0, $number, null);

        foreach ($this->getParameters() as $pos => $parameter) {
            $result = $this->match($parameter, $parameters);

            if ($result) {
                $arguments[$pos] = $result[1];
                unset($parameters[$result[0]]);
                continue;
            }

            if ($parameter->isDefaultValueAvailable()) {
                $arguments[$pos] = $parameter->getDefaultValue();
                continue;
            }

            throw UnresolvableArgumentException::fromParameter($parameter);
        }

        return $arguments;
    }
686903
public static function find($parameters = null)
    {
        $results = parent::find($parameters);
        $newResult = [];

        if ($results) {
            foreach ($results as $result) {
                $customFields = $result->getAllCustomFields();
                if (is_array($customFields)) {
                    //field the object
                    foreach ($customFields as $key => $value) {
                        $result->{$key} = $value;
                    }

                    $newResult[] = $result;
                }
            }

            unset($results);
        }
        return $newResult;
    }
1331698
public static function fromArray(Array $parameters)
    {
        $host = isset($parameters['host']) ? $parameters['host'] : self::DEFAULT_HOST;
        $port = isset($parameters['port']) ? $parameters['port'] : self::DEFAULT_PORT;
        $user = isset($parameters['username']) ? $parameters['username'] : null;
        $pass = isset($parameters['password']) ? $parameters['password'] : null;
        $db = isset($parameters['database']) ? $parameters['database'] : null;

        return new self($host, $port, $user, $pass, $db);
    }
10821
public function setParameters($parameters)
    {
		$this->parameters = [];
		
		if(!is_array($parameters)){
			$parameters = Helpers::convertStringToArray($parameters, '|');
		}
        
        foreach ($parameters as $parameter) {
            $this->parameters[] = Helpers::eliminateDupilcates($parameter, "\\");
        }
    }
959839
protected function getFormParams($parameters = array())
    {
        $formParams = $parameters;

        if (!array_key_exists('api_output', $formParams)) {
            $formParams['api_output'] = Api::DEFAULT_OUTPUT;
        }

        if (!array_key_exists('api_key', $formParams)) {
            $formParams['api_key'] = $this->apiKey;
        }

        return $formParams;
    }
292359
public static function prepareParameters(array $parameters)
    {
        $toConvert = [ 'amount', 'price' ];

        if (self::needsAmountConversion($parameters)) {
            if ($converter = Stripe::getAmountConverter()) {
                foreach ($toConvert as $to) {
                    if (isset($parameters[$to])) {
                        $parameters[$to] = forward_static_call_array(
                            $converter, [ $parameters[$to] ]
                        );
                    }
                }
            }
        }

        $parameters = array_map(function ($parameter) {
            return is_bool($parameter) ? ($parameter === true ? 'true' : 'false') : $parameter;
        }, $parameters);

        return preg_replace('/\%5B\d+\%5D/', '%5B%5D', http_build_query($parameters));;
    }