Convert the params to an array that is suitable to be passed in the ssh2_connect $methods parameter

@param  Project $p
@return array
342056
public function toArray(Project $p)
    {
        $client_to_server = $this->getClientToServer($p);
        $server_to_client = $this->getServerToClient($p);

        $array = [
            'kex' => $this->getKex($p),
            'hostkey' => $this->getHostkey($p),
            'client_to_server' => null !== $client_to_server ? $client_to_server->toArray() : null,
            'server_to_client' => null !== $server_to_client ? $server_to_client->toArray() : null
        ];

        return array_filter($array, [$this, '_filterParam']);
    }
1277714
protected function loadPearPackageScanner(Project $p)
    {
        $this->pps = new PearPackageScanner();
        $this->pps->setDescFile($this->packageFile);
        $this->pps->setPackage($this->package);
        $this->pps->setChannel($this->channel);
        $this->pps->setRole($this->role);
        $this->pps->setConfig($this->config);
        $this->pps->setIncludes($this->defaultPatterns->getIncludePatterns($p));
        $this->pps->setExcludes($this->defaultPatterns->getExcludePatterns($p));
        $this->pps->scan();
    }
1192955
private function buildRequestParams($method, $parameters = array()) {

        switch ($this->mode) {
            case 'client':
                $parameters['email'] = $this->email;
                $parameters['tkn']   = $this->token;
                $parameters['a']     = $method;
                break;
            case 'host':
                $parameters['host_key'] = $this->host_key;
                $parameters['act']      = $method;
                break;
        }


        return $parameters;
    }
1153120
public function getDir(Project $p)
    {
        if ($this->isReference()) {
            $ref = $this->getRef($p);

            return $ref->getDir($p);
        }

        return $this->dir;
    }
298408
public function get($project, $optParams = array()) {
      $params = array('project' => $project);
      $params = array_merge($params, $optParams);
      $data = $this->__call('get', array($params));
      if ($this->useObjects()) {
        return new Project($data);
      } else {
        return $data;
      }
    }
961816
function getMethodParams($class, $method) {
        if(!is_callable([$class, $method])){
            return self::NOT_CALLABLE;
        }
        $reflectMethod = new \ReflectionMethod($class, $method);
        $params        = [];
        foreach ($reflectMethod->getParameters() as $param) {
            $_param = '$' . $param->getName();
            if ($param->isDefaultValueAvailable()) {
                $default = $param->getDefaultValue();
                switch (mb_strtolower(gettype($default))) {
                    case 'null':
                        $default = 'null';
                        break;
                    case 'array':
                        $default = '[]';
                        break;
                    case 'string':
                        $default = '\'' . $default . '\'';
                        break;
                    case 'boolean':
                        $default = $default ? 'true' : 'false';
                        break;
                    default:
                        $default = $default;
                        break;
                }
                $_param .= ' = ' . $default;
            }
            $params[] = $_param;
        }
        return implode(', ', $params);

    }
1174676
protected function getMethodParameters($method, $docBlock = null): array
    {
        $result = [];

        /** @var \ReflectionParameter $param */
        foreach ($method->getParameters() as $param) {
            $parameter = new SmdParameter();
            $parameter->name = $param->getName();
            if (PHP_VERSION_ID > 70000) {
                $parameter->types = [(string)$param->getType()];
            }
            $parameter->optional = $param->isOptional();
            if ($parameter->optional) {
                $parameter->default = $param->getDefaultValue();
            }

            $result[$param->getName()] = $parameter;
        }

        if ($docBlock === null) {
            return array_values($result);
        }

        $params = $docBlock->getTagsByName(self::API_METHOD_DEFAULT_PARAMS);

        /** @var DocBlock\Tags\Param $param */
        foreach ($params as $param) {
            $name = (string)$param->getVariableName();

            $parameter = $result[$name] ?? new SmdParameter();
            $parameter->name = $name;

            if (!empty((string)$param->getDescription())) {
                $parameter->description = (string)$param->getDescription();
            }
            if (!empty((string)$param->getType())) {
                $parameter->types = explode('|', (string)$param->getType());
            }

            $result[$name] = $parameter;
        }

        /** @var ApiParam[] $params */
        $params = $docBlock->getTagsByName(self::API_METHOD_PARAMS);

        foreach ($params as $param) {
            $result = $this->getExtendedParameters($param, $result);
        }

        return array_values($result);
    }
1342992
public function getParams()
    {
        $params = [];
        foreach ($this as $key => $value) {
            $pname = (string) ltrim(strtolower(preg_replace('/[A-Z]/', '_$0', $key)), '_');
            $params[$pname] = $value;
        }
        return $params;
    }
75177
private function buildParam(Route $route): array
    {
        $param = [];

        $url = \explode('/', $route->url);
        $matches = \explode('/', $this->routeMatches[0]);

        $rawParam = \array_diff($matches, $url);

        foreach ($rawParam as $key => $value) {
            $paramName = \strtr($url[$key], ['[' => '', ']' => '']);
            $param[$paramName] = $value;
        }

        return $param;
    }
685589
protected function parseNamedParameters($parameters)
    {
        return array_reduce($parameters, function ($result, $item) {
            [$key, $value] = array_pad(explode('=', $item, 2), 2, null);

            $result[$key] = $value;

            return $result;
        });
    }
1055666
private function _get_args_from_params(array $params)
	{
		$byType	=	$this->container->requestRouteParams;
		$args	=	[];
		foreach ($params as $param)
		{
			if ($param->hasType() && isset($byType[$type = strtolower($param->getType())]))
				$args[] = $byType[$type];
			else if (isset($this->params[$param->name]))
				$args[] = $this->params[$param->name];
			else if (isset($_GET[$param->name]))
				$args[] = $_GET[$param->name];
			else if (isset($_POST[$param->name]))
				$args[] = $_POST[$param->name];
			else
			{
				if ( ! $param->isOptional())
					throw new \Exception('Unable to find NON-optional parameter `' . $param->name . ($param->hasType() ? '` of type `' . $param->getType() : null) . '` for route controller/handler: ' . var_export($this->route, true));
				$args[] = $param->getDefaultValue();
			}
		}
		return $args;
	}
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);
    }
744397
public function getHttpMethodsAsArray()
    {

        // initialize the array for the HTTP methods
        $httpMethods = array();

        // prepare the HTTP methods
        /** @var \AppserverIo\Appserver\Core\Api\Node\HttpMethodNode $httpMethodNode */
        foreach ($this->getHttpMethods() as $httpMethodNode) {
            $httpMethods[] = strtoupper($httpMethodNode->__toString());
        }

        // return the array with the HTTP methods
        return $httpMethods;
    }
459700
private function prepareMultipartParameters(array $params): array
    {
        $postDataMultipart = [];
        foreach ($params as $key => $value) {
            // If $value is not an array we cast it to an array
            foreach ((array) $value as $subValue) {
                $postDataMultipart[] = [
                    'name' => $key,
                    'content' => $subValue,
                ];
            }
        }

        return $postDataMultipart;
    }
522780
public static Map<String, QueryParameter> getParentDependentParameters(List<QueryParameter> params, QueryParameter p) {
        List<String> names = p.getDependentParameterNames();
        Map<String, QueryParameter> result = new HashMap<String, QueryParameter>();
        for (String name : names) {        	
            result.put(name, getParameterByName(params, name));
        }
        return result;
    }
1052250
public function getDirectoryScanner(Project $p = null)
    {
        if ($p === null) {
            $p = $this->getProject();
        }
        if ($this->isReference()) {
            $obj = $this->getRef($p);

            return $obj->getDirectoryScanner($p);
        }

        $this->loadPearPackageScanner($p);

        return $this->pps;
    }
637339
public function getIncludePatterns(Project $p)
    {
        if ($this->isReference()) {
            $o = $this->getRef($p);

            return $o->getIncludePatterns($p);
        } else {
            $this->readFiles($p);

            return $this->makeArray($this->includeList, $p);
        }
    }