@param string          $method
@param array|\stdClass $args

@resolve mixed
343925
public function call(string $method, $args): \Generator
    {
        $request = new Request();
        $request->id = $this->idSequence->current();
        $this->idSequence->next();
        $request->method = $method;
        $request->params = $args;

        $serializedRequest = Json::encode($this->mapper->dump($request));
        $this->pendingRequests[$request->id] = yield Recoil::strand();
        yield Recoil::execute($this->transport->send($serializedRequest));

        /** @var ResultResponse|ErrorResponse $response */
        $response = yield Recoil::suspend();

        if ($response instanceof ErrorResponse) {
            throw $response->error;
        }

        return $response->result;
    }
858293
public function walk($method, $arg = null, $object = null)
    {
        $result = array();
        foreach ($this->items($object) as $item) {
            $itemResult = $item->$method($arg);
            if ($itemResult === $item) {
                continue;
            }
            if (!is_array($itemResult)) {
                $result[] = $itemResult;
            } elseif (isset($itemResult[0])) {
                array_splice($result, count($result), 0, $itemResult);  
            } elseif (count($itemResult)) {
                $result += $itemResult;
            }
        }
        
        return $result;
    }
192640
protected static function call_subplugins_method_with_args($method, array $args = [], string $interface = null) {
        if (!isset($interface)) {
            $interface = \tool_log\local\privacy\logstore_provider::class;
        }
        \core_privacy\manager::plugintype_class_callback('logstore', $interface, $method, $args);
    }
896223
public function detect($method = 'isMobile', $args = null) {
		if (!class_exists('Mobile_Detect')) {
			// load the vendor class if it hasn't allready been autoloaded.
			$loaded = App::import('Vendor', 'MobileDetect.MobileDetect', array(
				'file' => 'MobileDetect' . DS . 'Mobile_Detect.php')
			);
			// abort if vendor class wasn't autoloaded and can't be found.
			if (!$loaded) {
				throw new CakeException('Mobile_Detect is missing or could not be loaded.');
			}
		}
		// instantiate once per method call
		if (!($this->MobileDetect instanceof Mobile_Detect)) {
			$this->MobileDetect = new Mobile_Detect();
		}

		return $this->MobileDetect->{$method}($args);
	}
370131
public function RPCall($method, $args)
    {
        if ($method === 'registerPair') {
            list($local, $foreign, $user) = $args;
            $this->pairs[$local . ':' . $foreign] = $user;
        } elseif ($method === 'unregisterPair') {
            list($local, $foreign) = $args;
            unset($this->pairs[$local . ':' . $foreign]);
        }
    }
567728
protected function callOnceAfterMethodHooks($classInstance, $method, array $args = [])
    {
        $method = self::getCalledMethod($method);

        $onceAfterMethodName = 'onceAfter'.ucfirst($method);
        if ( ! isset($this->instanceOnceCalledMethods['after'][$onceAfterMethodName])) {
            if (isset($this->hooks[$onceAfterMethodName])) {
                $this->instanceOnceCalledMethods['after'][$onceAfterMethodName] = true;

                foreach ($this->hooks[$onceAfterMethodName] as $callable) {
                    try {
                        $return = $this->callCallable($classInstance, $callable, $args, $method, false);
                    } catch (CancelPropagationException $e) {
                        break;
                    }

                    if ($return !== null) {
                        return $return;
                    }
                }
            }
        }

        $return = $this->callGlobalOnceAfterMethodHooks($classInstance, $method, $onceAfterMethodName);

        if ($return !== null) {
            return $return;
        }
    }
440091
protected function callBeforeHooks($classInstance, $method, array $args = [])
    {
        $return = $this->callBeforeAllHooks($classInstance, $method);

        if ($return !== null) {
            return $return;
        }

        $return = $this->callBeforeMethodHooks($classInstance, $method, $args);

        if ($return !== null) {
            return $return;
        }

        $return = $this->callOnceBeforeHooks($classInstance, $method, $args);

        if ($return !== null) {
            return $return;
        }
    }
547292
public static function callStatic($class, $method, $args = null)
    {
        $args   = \func_get_args();
        $class  = \array_shift($args);
        $method = \array_shift($args);

        $refl = new \ReflectionClass($class);
        $reflMethod = $refl->getMethod($method);
        $reflMethod->setAccessible(true);

        return $reflMethod->invokeArgs(null, $args);
    }
1112762
protected function call($method, $args)
    {
        $method = str_replace("_", ".", $method);
        $request = new $this->requestClass($this->apiKey, $method, $args, $this->secure);
        return $request->execute();
    }
1277837
protected function request($method, array $args)
    {
        $http = $this->getHttp();
        // If didn`t set $args then set $args to the empty array
        $args = array_replace(['', [], []], $args);
        // Set the cookies
        if (!isset($args[2]['cookies'])) {
            $args[2]['cookies'] = $this->getCookie();
            // Set the query string xh
            $args[2]['query']['xh'] = $this->getUserName();
        }
        // Set the proxy and cross the campus network vpn
        if (Config::get('proxy_status', false)) {
            $args[2]['proxy'] = Config::get('proxy', '');
        }
        // Set the request headers
        if ($headers = Config::get('http_headers')) {
            $args[2]['headers'] = $headers;
        }
        // Get the viewstate field
        if (isset($args[1]['__VIEWSTATE']) && true === $args[1]['__VIEWSTATE']) {
            $args[1]['__VIEWSTATE'] = $this->getViewsState($args[0]);
        }
        // Set the uri prefix for the cookies in url
        $args[0] = Config::get('param.url_prefix', '') . $args[0];
        // Try to get the response
        $response = call_user_func_array([$http, $method], $args);
        // Check whether need to request again with the url prefix
        $body = (string)$response->getBody();
        // The case of "Object moved to <a href='/(palpi545qhgbee55fvfekz45)/path.aspx" retry to new uri
        if (preg_match('/Object\ moved\ to\ <a\ href=[\'"]?\/(\(\w+\))/i', $body, $matches)) {
            // Set the new retry request`s uri
            $uriPrefix = $matches[1] . '/';
            Config::set('param.url_prefix', $uriPrefix);
            // Reset the request url path and request again
            $args[0] = $uriPrefix . $args[0];
            $response = call_user_func_array([$http, $method], $args);
        }

        return $response;
    }
1064203
protected function isCallable($arg, $method = null)
    {
        if (is_callable($arg) || is_callable([$arg, $method]) || $this->isClass($arg)) {
            return true;
        }

        return false;
    }
821923
private function magicWhere($method, $args)
    {
        $whereStatement = explode('_', $method);

        // Get where
        if (count($whereStatement) == 2) {
            return $this->getWhere($args[0], '=', $args[1]);
        }

        $operators = [
            'in', 'between', 'like', 'null',
            'not',
            'first', 'last',
            'many',
        ];

        // If an operator is found then add operators.
        if (array_intersect($whereStatement, $operators)) {
            list($operator, $firstOrLast, $inverse) = $this->determineMagicWhereDetails($whereStatement);

            $column = $args[0];
            $value  = (isset($args[1]) ? $args[1] : null);

            return $this->getWhere(
                $column,
                $operator,
                $value,
                $inverse,
                $firstOrLast
            );
        }
    }
1106966
public function callMethod($class, $method, array $args = array())
    {
        $method = $this->findMethod($class, $method);
        $method->setAccessible(true);

        return $method->invokeArgs(
            is_object($class) ? $class : null,
            $args
        );
    }
284079
public function logFeature(string $class, string $method, array $args) : void
    {
        if (!isset($this->logged[$class])) {
            $this->logged[$class] = [];
        }
        if (!isset($this->logged[$class][$method])) {
            $this->logged[$class][$method] = [];
        }
        if (!in_array($args, $this->logged[$class][$method])) {
            $this->logged[$class][$method][] = $args;
        }
    }
238194
protected function invokeRpc($method, $args)
    {
        if (empty($this->rpc['method']) || ! in_array($method, $this->rpc['method']) || empty($this->rpc['host'])) {
            throw new Exception('非法调用:' .$method . '@' . get_class($this));
        }

        $rpc = new Client($this->rpc['host']);

        return $rpc->exec($this->modName, $method, $args);
    }
902057
public function send($method,$arg1="",$arg2="") {

        // if we have a string, send it as well
        if($arg1 != "" && $arg2 != "")
        {
            $command = "$method \"$arg1\" \"$arg2\"";
        }
        elseif($arg1 != "") {
            $command = "$method \"$arg1\"";
        }
        else {
            $command = $method;
        }


        fputs($this->fp,"$command\n"); //Do desired action!
        $c = 0;
        while(!feof($this->fp)) {
            $got =  fgets($this->fp,1024);
            if(strncmp("OK",$got,strlen("OK"))==0)
                break;
            if(strncmp("ACK",$got,strlen("ACK"))==0)
                break;

            $ret[$c]=$got;
            $c++;
        }

        $sentResponse = array(
            "response" => $this->response,
            "got" => $got,
            "ret" => $ret
        );
        return $sentResponse;

    }
768474
protected function writeCacheRecord($method, $args)
    {
        $this->checkReservedKeyPattern($args['key']);

        call_user_func_array([$this, 'storeKeywords'], array_only($args, ['key', 'minutes', 'keywords']));

        if (! $this->operatingOnKeywords()) {
            $this->resetCurrentKeywords();
        }

        call_user_func_array(['parent', $method], array_values($args));
    }