To set get parameters.

@param array $args

@return string
332338
protected function setParams(array $args)
    {
        if (!empty($args)) {
            $request = '?';
        } else {
            $request = '';
        }

        foreach ($args as $key => $value) {
            if (is_numeric($key)) {
                if ($request != '?') {
                    $request .= '&';
                }
                $request .= $value;
            } elseif (is_string($key)) {
                if ($request != '?') {
                    $request .= '&';
                }
                $request .= $key.'='.$value;
            }
        }

        return $request;
    }
790959
protected static function getParams(array $arg_params)
    {
        $return = array();
        //validate params
        $data = array(
            'amount',
            'transaction_id',
            'customer_id',
            'security_token',
            'customer_ip'
        );
        foreach ($data as $key) {
            if(!empty($arg_params[$key])){
                $return[$key] = $arg_params[$key];
            }
        }

        return $return;
    }
1262566
public function formatArgs($args)
    {
        // The first argument is always the file
        unset($args[0]);

        if (isset($args[1])) {
            $command = explode(':', $args[1]);
            unset($args[1]);
        } else {
            // No Command Specified.
            return array();
        }

        try {

            $action = (isset($command[1]) ? $command[1] : 'main');
            $cmd = $this->library->find($command[0].':'.$action);
            $task = get_class($cmd);

            return array(
                'task'      => $task,
                'action'    => $action,
                'params'    => $args
            );

        } catch (\Exception $e) {

            // No Command FOUND
            return array();
        }
    }
720843
public function getFields(array $args = [])
    {
        if (empty($args)) {
            return $this->fields;
        }

        return \array_filter($this->fields, function (AbstractType $field) use ($args) {
            return $field->filter($args);
        });
    }
79020
protected function parseAttributes( array $args )
	{
		if( empty( $args['attributes'] )) {
			return [];
		}

		$attributes = (array) $args['attributes'];

		foreach( $attributes as $key => $value ) {
			if( is_string( $key ))continue;
			unset( $attributes[ $key ] );
			if( !isset( $attributes[ $value ] )) {
				$attributes[ $value ] = '';
			}
		}

		return $attributes;
	}
150241
protected function get($args)
    {
        $target = $args['target'];
        $volume = $this->volume($target);

        if (!$volume || ($file = $volume->file($target)) == false) {
            return array('error' => $this->error(self::ERROR_OPEN, '#'.$target, self::ERROR_FILE_NOT_FOUND));
        }

        if (($content = $volume->getContents($target)) === false) {
            return array('error' => $this->error(self::ERROR_OPEN, $volume->path($target), $volume->error()));
        }

        $json = json_encode($content);

        if ($json == 'null' && strlen($json) < strlen($content)) {
            return array('error' => $this->error(self::ERROR_NOT_UTF8_CONTENT, $volume->path($target)));
        }

        return array('content' => $content);
    }
1137248
protected function getKeyMethod($args)
    {

        if (!is_array($args) || !isset($args[0]) || !is_string($args[0])) {
            return '';
        }

        if (isset($this->_methodCache[$args[0]])) {
            return $this->_methodCache[$args[0]];
        }

        $method = $this->keyMethodName($args[0]);

        $this->_methodCache[$args[0]] = method_exists($this, $method) ? $method : '';

        return $this->_methodCache[$args[0]];
    }
1128137
public static function escape(array $args): string
  {
    $command = '';
    foreach ($args as $arg)
    {
      if ($command!='') $command .= ' ';
      $command .= escapeshellarg($arg);
    }

    return $command;
  }
458015
public static function buildParameters(array $args)
    {
        $parameters = [];

        if (count($args) > 2) {
            $parameters[] = $args[0];
            foreach ($args[1] as $param) {
                $parameters[] = $param;
            }
        } else {
            foreach ($args[0] as $param) {
                $parameters[] = $param;
            }
        }

        return $parameters;
    }
1219151
public function parse(array $args = []) : string
    {
        $strAux = $this->str;
        $params = $this->getParameters();

        foreach ($args as $argKey => $argValue) {
            if (in_array($argKey, $params)) {
                $strAux = str_replace("{{$argKey}}", $argValue, $strAux);
            }
        }

        return $strAux;
    }
728752
public function getParametersDictionary(array $args = [])
    {
        $dictionary = [];

        foreach ($args as $parameter) {
            if (!is_object($parameter)) continue;
            $dictionary[get_class($parameter)] = $parameter;
        }

        return array_merge($args, $dictionary);
    }
1254847
protected function getFromMethod($args)
    {
        if (!$method = $this->getKeyMethod($args)) {
            return '';
        }

        array_shift($args);

        return call_user_func([$this, $method], ...$args);
    }
105984
protected function getSearchQuery(array $args)
    {
        return implode(' ', array_map(function ($term) {
            return strpos($term, ' ') ? '"' . $term . '"' : $term;
        }, $args));
    }
1003523
public function fetchSingle(...$args)
    { 
        $args[] = QB::limit(1);
        $select = $this->select($args);
        return $select->fetch();
    }
686914
protected function serializeArguments(array $args)
    {
        // first we have to sort the args by key to avoid that different orders
        // lead to different cache entries!
        ksort($args);

        $result = '';
        $invalidKeys = array('userid', 'apikey', 'keyid', 'vcode');
        foreach ($args as $key => $value) {
            $key   = trim($key);
            $value = trim($value);
            if (empty($value) || in_array($key, $invalidKeys)) {
                // ignore the invalid keys...
                continue;
            }
            $result .= ';' . $key . '=' . $value;
        }

        return $result;
    }
590006
protected function getServiceByArgs($args) {
		$args = $this->normalizeArgs($args);
		$id   = $this->getIdByArgs($args);
		$args = $this->processArgs($args);
			
		if (! isset($this->servicesByArgs[$id])) {
			$this->servicesByArgs[$id] = $this->initService($args);
		}

		return $this->servicesByArgs[$id];
	}
986959
protected function getArgumentOutput(array $args) : string
    {
        $out = '  Original arguments:' . PHP_EOL;
        foreach ($args as $name => $value) {
            $out .= '    ' . $name . ' => <comment>' . $value . '</comment>' . PHP_EOL;
        }
        return $out;
    }