parse custom array params
```php
$result = Flags::parseArray([
'arg' => 'val',
'--lp' => 'val2',
'--s' => 'val3',
'-h' => true,
]);
```
@param array $params
@return array
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];
    }
1093590
protected static function prepareValueS($str, array $params = [])
    {
        $result = $str;
        foreach ($params as $key => $value) {
            $result = str_replace('{'.$key.'}', $value, $result);
        }
        return $result;
    }
278950
private function parseResizeParams(array $params = []): array
    {
        $resizeParams = [];
        foreach ($params as $param) {
            \preg_match('/^('.\implode('|', $this->allowedResizeParams).')([0-9]+)$/', $param, $matches);
            if (isset($matches[1]) && isset($matches[2])) {
                $resizeParams[$matches[1]] = (int)$matches[2];

                if ($matches[1] == 'gs') {
                    $resizeParams[$matches[1]] = ((int)$matches[2] === 1);
                }
            }
        }
        return $resizeParams;
    }
368064
protected function processResult(array $results)
    {
        foreach ($results as $key => $entity) {

            if (!empty($entity['data'])) {

                $entity['data'] = $this->decorator->denormalizeValue($entity['data']);
                $results[$key] = $entity;
            }
        }

        return $results;
    }
1044090
public function loadResult($params=array()) {
		
		$this->openConnection();
		
		$res = NULL;

		try {

			$stat = $this->handler->prepare($this->query);
			$stat->execute((array)$params);
			
			// logger
			$count = $this->handler->query('SELECT FOUND_ROWS()')->fetchColumn();
			$this->logParamQuery($this->query, $count, $params);
			$res = $stat->fetch(\PDO::FETCH_COLUMN);	
		
		} catch (\PDOException $e) {

			$this->handleException($e, $params);

		}
		
		$stat->closeCursor();

		return $res;
		
	}
488940
static function parseParams($params, $schema) {
    $params = (array) $params;

    foreach (array_diff_key($schema, ['_validate' => 1]) as $k => $v) if (preg_match('/^_/', $k)) $params[$k] = $v;

    return $params;
  }
1314795
public function getParamTokens(array $params)
    {
        foreach ($params as $k => $p) {
            if (is_array($p)) {
                $params[$k] = isset($p[2]) ? $p[2] : 0;
            }
        }

        return $params;
    }
497769
private static function parseInputToString($params)
    {
        return is_array($params) ? array_map(function ($item) {
            return trim(htmlspecialchars($item, ENT_QUOTES, 'UTF-8'));
        }, $params) : trim(htmlspecialchars($params, ENT_QUOTES, 'UTF-8'));
    }
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;
    }
832269
public function setParamsSort(array $params) {
        if (is_numeric(key($params)) && key($params) == 0) {
            $tmp = [];
            foreach ($params as $key => $value) {
                $tmp[$key + 1] = $value;
            }
            $params = $tmp;
        }

        return $params;
    }
140325
protected function checkResult(array $results, array $params)
    {
        $exceptions = new Exception\SaveException();

        for ($i = 0; $i < count($results); $i++) {

            // If the param was an (s)object, set it’s Id field
            if (is_object($params[$i])
                && (!isset($params[$i]->Id) || null === $params[$i]->Id)
                && $results[$i] instanceof Result\SaveResult) {
                $params[$i]->Id = $results[$i]->getId();
            }

            if (!$results[$i]->isSuccess()) {
                $results[$i]->setParam($params[$i]);
                $exceptions->add($results[$i]);
            }
        }

        if ($exceptions->count() > 0) {
            throw $exceptions;
        }

        return $results;
    }
171687
private function processResult(array $result)
    {
        $this->checkResponseStatus($result['http_code']);

        // Get decoded response data
        $responseArr = json_decode($result['response'], true);

        $this->checkJsonError();

        return $responseArr;
    }
405238
public static function extractParamValues($params, &$values) {
        foreach ($params as $k => $v) {
            if (is_array($v) || is_object($v)) {
                self::extractParamValues($v, $values);
            } else {
                if (is_bool($v))  {
                    //if a value is set as false, invalid hash will generate
                    //https://github.com/sailthru/sailthru-php5-client/issues/4
                    $v = intval($v);
                }
                $values[] = $v;
            }
        }
    }
1363775
final private function splitParameters(array $params):array
    {
        $a = array();
        foreach ($params as $one) {
            if (strpos($one, ":") !== false) {
                $u = explode(":", $one);
                if (count($u) < 2) {
                    throw new Server500(new \ArrayObject(array("explain" => "Delimiter ':' is missing ",
                        "solution" => "Please check Mercure file")));
                }
                $this->checkScalarValue($u[1]);
                array_push($a, $u);
            } else {
                throw new Server500(new \ArrayObject(array("explain" => "Delimiter ':' is missing ",
                    "solution" => "Please check Mercure file")));
            }
        }
        return ($a);
    }
471404
public function execute(array $params = []) : array
    {
        foreach ($params as $paramName => $paramValue) {
            $type = is_int($paramValue) ? \SQLITE3_INTEGER : \SQLITE3_TEXT;
            $this->getStatement()->bindValue($paramName, $paramValue, $type);
        }
        $result = $this->getStatement()->execute();

        $results = [];
        while ($row = $result->fetchArray(\SQLITE3_ASSOC)) {
            $results[] = $row;
        }

        return $results;
    }
943927
public static function prepare($params = [])
    {
        $positions = array_combine(array_keys($params), array_fill(0, count($params), 0));
        $data = [];

        do {
            $data[] = self::getByIndexes($params, $positions);
        } while (self::updateIndexesToNextIteration($params, $positions));

        return $data;
    }
806472
protected function normalizeParams(array $params) {
		$processed = [];
		
		foreach ($params as $param => $value) {
			$processed[sprintf($this->paramsPattern, $param)] = $value;
		}
		
		return $processed;
	}