Resolve the params of an array

@param array $params
@return array
161445
public static function resolveParams(Container $container, $params)
    {
        $resolvedParams = array();
        foreach($params as $key=>$param) {
            $resolvedParam = null;
            if (is_array($param)) {
                $resolvedParam = self::resolveParams($container, $param);
            } else if (is_string($param)){
                $resolvedParam = $container->resolve($param);
            } else {
                $resolvedParam = $param;
            }
            $resolvedParams[$key] = $resolvedParam;
        }
        return $resolvedParams;
    }
1293222
public function execute(array $params = []) : array
    {
        foreach ($params as $paramName => $paramValue) {
            $type = is_int($paramValue) ? \PDO::PARAM_INT : \PDO::PARAM_STR;
            $this->getStatement()->bindValue($paramName, $paramValue, $type);
        }
        $this->getStatement()->execute();

        return $this->getStatement()->fetchAll(\PDO::FETCH_ASSOC);
    }
400438
protected function actionGet($params=array())
    {
        $response = array(
            'errors'=>array(),
            'data' => array(
                'count' => 0,
                'items' => array(),
            ),
        );
        $offset = isset($params['offset'])?(int)$params['offset']:0;
        if ($offset < 0) $offset = 0;
        $count = isset($params['count'])?(int)$params['count']:100;
        if ($count < 1) $count = 1;
        if ($count > 100) $count = 100;
        $filter = array(
            'fields' => array(),
            'offset' => $offset,
            'count' => $count,
        );
        $idsRaw = isset($params['ids'])?(string)$params['ids']:null;
        $idsRaw = preg_replace('/[^a-f0-9\,]/ui','',$idsRaw);
        $idsRaw = preg_replace('/^\,+|\,+$/ui','',$idsRaw);
        $idsRaw = preg_replace('/\,+/ui',',',$idsRaw);
        if (!empty($idsRaw)) {
            $ids = explode(',',$idsRaw);
            if (count($ids) > 1) {
                $filter['fields'][] = array(
                    'field' => 'id',
                    'compare' => 'in',
                    'value' => $ids,
                );
            } elseif (count($ids) == 1) {
                $filter['fields'][] = array(
                    'field' => 'id',
                    'compare' => '=',
                    'value' => $ids[0],
                );
            }
        }
        $street = isset($params['street'])?trim((string)$params['street']):null;
        $number = isset($params['number'])?trim((string)$params['number']):null;

        if ($street && !$number) {
            $filter['fields'][] = array(
                'field' => 'street',
                'compare' => '=',
                'value' => $street,
            );
        }
        if (!$street && $number) {
            $filter['fields'][] = array(
                'field' => 'number',
                'compare' => '=',
                'value' => $street,
            );
        }
        if ($street && $number) {
            $filter['fields'][] = array(
                'field' => 'id',
                'compare' => '=',
                'value' => $this->build->getId(array('street'=>$street,'number'=>$number)),
            );
        }
        $response['data']['count'] = $this->build->count($filter);
        $builds = $this->build->find($filter);
        $response['data']['items'] = $builds;
        return $response;
    }
983933
private function parseIgnoredParams(array $queryParams)
    {
        if (empty($queryParams)) {
            return $queryParams;
        }

        if ($this->ignoredQuery === '*') {
            if ($this->includedQuery === '*') {
                return $queryParams;
            }

            if (empty($this->includedQuery) && !is_numeric($this->includedQuery)) {
                return [];
            }

            return array_intersect_key($queryParams, array_flip((array)$this->includedQuery));
        }

        if (empty($this->ignoredQuery) && !is_numeric($this->ignoredQuery)) {
            return $queryParams;
        }

        return array_diff_key($queryParams, array_flip((array)$this->ignoredQuery));
    }
831946
private function get_filter_params( $params ) {
		$priority      = 10;
		$accepted_args = 100;
		if ( is_array( $params ) ) {
			if ( count( $params ) >= 1 ) {
				$priority = $params[0];
			}
			if ( count( $params ) >= 2 ) {
				$accepted_args = $params[1];
			}
		}

		return [ $priority, $accepted_args ];
	}
569850
protected function _getClientParams( array $params, array $prefixes = array( 'f', 'l', 'd', 'a' ) )
	{
		$list = array();

		foreach( $params as $key => $value )
		{
			if( in_array( $key[0], $prefixes ) && $key[1] === '-' ) {
				$list[$key] = $value;
			}
		}

		return $list;
	}
1293946
private function splitParams(array $params)
    {
        $parameters = [];
        $files      = [];

        foreach ($params as $name => $value) {
            if (is_readable($value)) { //file
                $files[$name] = $value;
            } else {
                $parameters[$name] = $value;
            }
        }

        return [$parameters, $files];
    }
870339
protected function formatKVLists(array $params)
    {
        $formatted = [];

        foreach ($params as $name => $value) {
            $formatted[] = [
                'key' => $name,
                'value' => strval($value),
            ];
        }

        return $formatted;
    }
219586
public function get($params = [])
    {
        $result = $this->connection()->get($this->getEndpoint(), $params);

        return $this->collectionFromResult($result);
    }
369612
protected function parseRelationshipParams(array $params): array
    {
        if (empty($params)) {
            return [];
        }
        $parsed = [];
        foreach ($params as $key => $value) {
            # loop through
            if (is_int($key)) {
                $parsed[$key] = '';
                continue;
            }
            if ($key !== 'paginate' || ($key === 'paginate' && !Arr::isAssoc($value))) {
                $key = $key === 'paginate' ? 'limit' : $key;
                $parsed[$key] = implode('|', $value);

            } else {
                $limit = $this->findInArray($value, 'limit', 0, 10);
                $offset = $this->findInArray($value, 'offset', 1, 0);
                $parsed['limit'] = $limit . '|' . $offset;
            }
        }
        return $parsed;
    }
500037
public static function parseArray(array $params): array
    {
        $args = $sOpts = $lOpts = [];

        foreach ($params as $key => $val) {
            if (\is_int($key)) { // as argument
                $args[$key] = $val;
                continue;
            }

            $cleanKey = \trim((string)$key, '-');

            if ('' === $cleanKey) { // as argument
                $args[] = $val;
                continue;
            }

            if (0 === \strpos($key, '--')) { // long option
                $lOpts[$cleanKey] = $val;
            } elseif (0 === \strpos($key, '-')) { // short option
                $sOpts[$cleanKey] = $val;
            } else {
                $args[$key] = $val;
            }
        }

        return [$args, $sOpts, $lOpts];
    }
438496
public function fetchArray($params = false)
    {
        if (\count($this->values) === 0) {
            return false;
        }
        if (\count($this->values) > 1) {
            return $this->values;
        }
        if ($params === true) {
            return $this->values;
        }
        if (\is_array($params) && array_key_exists('item', $params)) {
            $item = $params['item'];
            if (array_key_exists($item, $this->values)) {
                return $this->values[$item];
            }
            if (array_key_exists($item, $this->values[0])) {
                return $this->values[0][$item];
            }
            return false;
        }

        return $this->values[0];
    }
550687
public static function decodeParams($params)
    {
        if(!$params) {
            return [];
        }
        $paramsArrayList = json_decode(json_encode($params), true);
        $decodedParams = [];
        foreach($paramsArrayList as $paramKey=>$paramValue){
            if(is_array($paramValue)) {
                foreach($paramValue as $languageSlug=>$langParamValue){
                    if($languageSlug == App::getLocale()) {
                        $decodedParams[$paramKey] = $langParamValue;
                        break;
                    }else{
                        $decodedParams[$paramKey] = "";
                    }
                }
            }else{
                $decodedParams[$paramKey] = $paramValue;
            }
        }
        return $decodedParams;
    }
160066
protected function serializeParams(array $params)
    {
        $serialized = array();
        foreach ($params as $param) {
            $serialized[] = $this->serializer->serialize($param);
        }

        return $serialized;
    }
1294939
public function transformParams(array $params): array
    {
        $newParams = [];
        foreach ($params as $key => $value) {
            $newParams['%' . $key . '%'] = $value;
        }

        return $newParams;
    }
1365584
private function resolveParameters(?array $params = [], ?array $definitions = null) : array
    {
        $parameters = [];

        //method doesn't exist so there's no parameters
        if(!isset($params) || empty($params)) {
            return $parameters;
        }

        /** @var \ReflectionParameter $parameter */
        foreach($params as $parameter) {

            //handle definitions
            if(isset($definitions, $definitions[$parameter->name])
                && is_a($definitions[$parameter->name], Definition::class)) {

                /** @var Definition $definition */
                $definition = $definitions[$parameter->name];
                $parameters[] = $definition->getType() == Definition::CONTAINER
                    ? $this->container->get($definition->getValue()) : $definition->getValue();

            } elseif($parameter->isDefaultValueAvailable()) {
                $parameters[] = $parameter->getDefaultValue();
            } elseif($parameter->allowsNull() || $parameter->isOptional() || !$parameter->hasType()) {
                $parameters[] = null;
            } elseif($parameter->getClass() !== null) {

                $parameter_class = $parameter->getClass();
                $parameter_class_name = $parameter_class->getName();

                try {
                    $parameters[] = $this->container->get($parameter_class_name);
                } catch(\Exception $e) {
                    $parameters[] = null;
                }

            } elseif($parameter->isCallable()) {
                $parameters[] = function(){};
            } elseif($parameter->isArray()) {
                $parameters[] = [];
            } else {
                $parameters[] = $this->resolveDefaultType($parameter->getType());
            }
        }

        return $parameters;
    }
159021
private function preParseParams(array $params)
    {
        if (!array_key_exists('fields', $params) || !is_array($params['fields'])) {
            return $params;
        }

        $fields = [];
        foreach ($params['fields'] as $index => $field) {
            if (!is_numeric($index)) {
                $fields[$index] = $field;
                continue;
            }

            $modifier = 1;
            /** @noinspection SubStrUsedAsArrayAccessInspection */
            $firstChar = substr($field, 0, 1);
            if ($firstChar === '+' || $firstChar === '-') {
                $modifier = $firstChar === '+' ? 1 : 0;
                $field = substr($field, 1);
            }
            $fields[$field] = $modifier;
        }
        $params['fields'] = $fields;

        return $params;
    }