Call a static method for a type

@param string $type
@param string $method
@param array $parameters
@return mixed
487651
public function &call($type, $method, $parameters = array())
	{
		$class = $this->get_class($type);

		if (in_array($class, $this->legacy))
		{
			switch ($type)
			{
				case 'Cache':
					// For backwards compatibility with old non-static
					// Cache::create() methods
					if ($method === 'get_handler')
					{
						$result = @call_user_func_array(array($class, 'create'), $parameters);
						return $result;
					}
					break;
			}
		}

		$result = call_user_func_array(array($class, $method), $parameters);
		return $result;
	}
602437
public function callAction($method, $parameters)
    {
        $route = app('router')->current();
        $request = app('request');
        $this->assignAfter($route, $request, $method);
        $response = $this->before($route, $request, $method);

        if (is_null($response)) {
            $response = call_user_func_array([$this, $method], $parameters);
        }

        return $response;
    }
268406
private function collectCacheCallData($method, array $arguments, array $trimmedBacktrace, string $type): void
    {
        // simplest/fastests hash possible to identify if we have already collected this before to save on memory use
        $callHash = \hash('adler32', $method . \serialize($arguments));
        if (empty($this->calls[$callHash])) {
            $this->calls[$callHash] = [
                'method' => $method,
                'arguments' => $arguments,
                'stats' => [
                    'uncached' => 0,
                    'miss' => 0,
                    'hit' => 0,
                    'memory' => 0,
                ],
                'traces' => [],
            ];
        }
        ++$this->calls[$callHash]['stats'][$type];

        $trace = $this->getSimpleCallTrace($trimmedBacktrace);
        $traceHash = \hash('adler32', \implode($trace));
        if (empty($this->calls[$callHash]['traces'][$traceHash])) {
            $this->calls[$callHash]['traces'][$traceHash] = [
                'trace' => $trace,
                'count' => 0,
            ];
        }
        ++$this->calls[$callHash]['traces'][$traceHash]['count'];
    }
886702
private static function from($type, $key, $default, &$source = null) {

    	if(null === $source) {

	    	if(static :: isMethod($type)) {

	    		$source = [];
	    		static :: parseRawHttpRequest($source);
	    	}
    	}

    	static :: $method = ['method' => $type, 'data' => &$source];

    	if(null !== $key) {
    		return static :: get($key, $default);
    	}

    	return $source;
    }
1304128
protected function call($method, array $params = array())
    {
        $this->init();

        // Prepare headers
        $this->soapClient->__setSoapHeaders($this->getSessionHeader());

        $requestEvent = new Event\RequestEvent($method, $params);
        $this->dispatch(Events::REQUEST, $requestEvent);

        try {
            $result = $this->soapClient->$method($params);
        } catch (\SoapFault $soapFault) {
            $faultEvent = new Event\FaultEvent($soapFault, $requestEvent);
            $this->dispatch(Events::FAULT, $faultEvent);

            throw $soapFault;
        }

        // No result e.g. for logout, delete with empty array
        if (!isset($result->result)) {
            return array();
        }

        $this->dispatch(
            Events::RESPONSE,
            new Event\ResponseEvent($requestEvent, $result->result)
        );

        return $result->result;
    }
29282
protected function tryCall($method, array $parameters): bool
    {
        $called = parent::tryCall($method, $parameters);
        if (!$called && substr($method, 0, 6) === 'action') {
            $class = get_class($this);
            throw new BadRequestException("Action '$class::$method' does not exist.");
        }

        return $called;
    }
849947
protected function callProtocolMethod(string $event, ...$parameters)
    {
        if (method_exists($this->protocol, $event)) {
            call_user_func_array([$this->protocol, $event], $parameters);
        }
    }
1093601
public static function create($method, $url = null)
    {
        return new static(new Method($method), null === $url ? null : new Url($url));
    }
1263521
public static function call($object, string $method, array $parameters)
    {
        $reflectionClass = new \ReflectionClass($object);
        $reflectionMethod = $reflectionClass->getMethod($method);
        $arguments = [];

        foreach ($reflectionMethod->getParameters() as $i => $reflectionParameter) {
            $argument = null;

            if (array_key_exists($reflectionParameter->name, $parameters) || array_key_exists($i, $parameters)) {
                $argument = $parameters[$reflectionParameter->name] ?? $parameters[$i] ?? null;
            } elseif ($reflectionParameter->isDefaultValueAvailable()) {
                $argument = $reflectionParameter->getDefaultValue();
            }

            if ($reflectionType = $reflectionParameter->getType()) {
                if ($reflectionType->isBuiltin()) {
                    if ($argument !== null || !$reflectionType->allowsNull()) {
                        settype($argument, $reflectionType->getName());
                    }
                } elseif ($argument === null && !$reflectionType->allowsNull()) {
                    return null;
                }
            }

            $arguments[] = $argument;
        }

        if ($reflectionMethod->isConstructor()) {
            return $reflectionClass->newInstanceArgs($arguments);
        }

        $reflectionMethod->setAccessible(true);

        return $reflectionMethod->invokeArgs($reflectionMethod->isStatic() ? null : $object, $arguments);
    }
1066595
public function method($method)
    {
        $method = strtoupper($method);
        if (in_array($method, static::METHODS)) {
            $this->def['method'] = $method;
        } else {
            $this->error = ['errcode'=>-1, 'errmsg'=>"Invalid method: $method"];
        }
        return $this;
    }
717272
protected function request($method, $url, $parameters = array())
    {
        Logger::get()->debug('HTTP: starting request...');
        $headers = $this->headers;

        // Add accepted content type header.
        $headers[] = 'Content-Type: ' . $this->contentType;
        $headers[] = 'Accept: ' . $this->acceptedContentType;

        $handler = curl_init();

        if (!is_null($this->user)) {
            curl_setopt($handler, CURLOPT_USERPWD, $this->user . ':' . $this->password);
        }

        Logger::get()->debug('HTTP: method is ' . $method);
        switch ($method) {
            case self::METHOD_DELETE:
                curl_setopt($handler, CURLOPT_URL, $url . '?' . http_build_query($parameters));
                curl_setopt($handler, CURLOPT_CUSTOMREQUEST, self::DELETE);
                break;
            case self::METHOD_POST:
                curl_setopt($handler, CURLOPT_URL, $url);
                curl_setopt($handler, CURLOPT_POST, true);
                curl_setopt($handler, CURLOPT_POSTFIELDS, $parameters);
                break;
            case self::METHOD_GET:
                curl_setopt($handler, CURLOPT_URL, $url . '?' . http_build_query($parameters));
                break;
        }

        curl_setopt($handler, CURLOPT_RETURNTRANSFER, true);
        curl_setopt($handler, CURLOPT_HTTPHEADER, $headers);
        Logger::get()->debug('HTTP: headers set.');

        // Send the request to the server.
        Logger::get()->debug("HTTP: requesting $url...");
        $output = curl_exec($handler);
        $errNo = curl_errno($handler);
        $error = curl_error($handler);
        // Obtain the status.
        Logger::get()->debug('HTTP: Done. Getting status...');
        $status = curl_getinfo($handler, CURLINFO_HTTP_CODE);
        // The handler is no longer needed.
        curl_close($handler);
        Logger::get()->debug('HTTP: request finished.');

        if ($errNo) {
            throw new Exception('HTTP: cURL failed: ' . $error, $errNo);
        }

        // If cURL had no errors itself, then there is an HTTP response.
        switch ($status) {
            case self::STATUS_OK:
            case self::STATUS_CREATED:
            case self::STATUS_ACCEPTED:
            case self::STATUS_NO_CONTENT:
                return $output;
            default:
                throw new Http\Exception("HTTP {$status}", $status);
        }
    }
913867
public function request($method, $uri, array $parameters = [])
    {
        return $this->container->get(AdapterInterface::class)
            ->request($method, $uri, $parameters);
    }
1371864
public function resolve(string $type, string $resource, array $parameters = [], $version = null)
    {
        $version = $version ?? $this->version;

        if (str_contains($resource, '.')) {
            list($resource, $related) = explode('.', $resource);
            $resourceDefinition = $this->loadRelatedDefinition($version, $resource, $related, $type);
        } else {
            $resourceDefinition = $this->loadDefinition($version, $resource, $type);
        }

        return $this->app->make($resourceDefinition, $parameters);
    }
158288
public function repository($name, $method, array $parameters = [])
    {
        return call_user_func_array(
            [ $this->getRepository($name), $method ],
            $parameters
        );
    }
1045338
protected function call( $type, $params ) {
		if ( !isset( $this->callbacks[$type] ) ) {
			return;
		}
		foreach ( $this->callbacks[$type] as $callback ) {
			if ( is_callable( $callback ) ) {
				call_user_func_array( $callback, $params );
			}
		}
	}
808153
protected static function staticRequest($method, $url, $params)
    {
        $requestor = new ApiRequestor();
        list($response, $code) = $requestor->request($method, $url, $params);
        return array($response, $code);
    }
231565
public function call($method, $uri, $parameters = [], $cookies = [], $files = [], $server = [], $content = null)
    {
        $this->currentUri = $this->prepareUrlForRequest($uri);

        $symfonyRequest = SymfonyRequest::create(
            $this->currentUri, $method, $parameters,
            $cookies, $files, $server, $content
        );

        $response = $this->app->prepareResponse(
            $this->app->handle(Request::createFromBase($symfonyRequest))
        );
        $this->response = $this->createTestResponse($response);

        return $this->response;
    }