Search method and execute if exists.

@param string $method_name
@param string $request_method
@param array $arguments
@return bool
346068
protected  function invoke($method_name, $request_method, array $arguments = []){
        $method_name = strtolower($request_method).'_'.$this->str->to_snake_case($method_name);
        // Check if method exists
        if( !is_callable([$this, $method_name]) ){
            return false;
        }
        // Check accessibility
        $reflection = new \ReflectionMethod($this, $method_name);
        if( !$reflection->isPublic() || $reflection->isStatic() ){
            return false;
        }
        // Check required arguments length
        if( $reflection->getNumberOfRequiredParameters() > count($arguments) ){
            return false;
        }
        // O.K. It's public method. Call it.
        $this->handle_result(call_user_func_array([$this, $method_name], $arguments));
        return true;
    }
169390
def method_missing(method_name, *arguments)
      klass = REGISTRY.fetch(method_name) { super }

      Evaluator.new(klass, arguments).rules.each do |rule|
        add(rule)
      end

      self
    end
154362
def request_method(self, method: str,
                       **method_kwargs: Union[str, int]) -> dict:
        
        response = self.session.send_method_request(method, method_kwargs)
        self.check_for_errors(method, method_kwargs, response)
        return response
126030
protected function execute($request_method, $url, $parameters = null)
	{
		$extra_options = array(
			CURLOPT_HTTPAUTH => CURLAUTH_BASIC,
			CURLOPT_USERPWD => $this->_apiUsername . ':' . $this->_apiKey,
		);

		$url = 'https://www.browserstack.com/automate/' . $url;

		list($raw_results,) = $this->_curlService->execute($request_method, $url, $parameters, $extra_options);

		return json_decode($raw_results, true);
	}
793084
private function doBeforeQuery($callback, $methodName, $arguments)
    {
        $traits = $this->getUsedTraits();

        if (in_array(CacheResults::class, $traits) && $this->caching && $this->isCacheableMethod($methodName)) {
            return $this->processCacheRequest($callback, $methodName, $arguments);
        }

        return $callback();
    }
124615
protected function call($method, &$arguments)
    {
        $matches = array();

        if (!preg_match('/^(?:(get|set|is)_?)(\w+)$/i', $method, $matches)) {
            return null;
        }

        $action = $matches[1];
        $name   = $matches[2];

        if ($action === 'is') {
            $name   = "is$name";
            $action = 'get';
        }

        $propertyName = lcfirst($name);

        if ($action === 'set') {
            return $this->set($propertyName, $arguments[0]);
        }
        else {
            return $this->get($propertyName);
        }
    }
631922
public function callHandler($handler_id, $name, array $arguments = array())
    {
        return Handler::call($this->getHandlers(), $handler_id, $name, $arguments);
    }
187886
private function addSelectionMethod(QueryBuilderResult $query, $methodName)
    {
        $findMethod = function () use ($query, $methodName) {

            $sth = $this->pdo->prepare($query->getSql());
            /** @noinspection PhpMethodParametersCountMismatchInspection */
            $sth->setFetchMode(\PDO::FETCH_CLASS, $this->entityClass->getName());
            try {
                $sth->execute(func_get_args());
            } catch (PDOException $e) {
                throw new DslSyntaxException('Failed to run query [' . $methodName . '] with parameters ' . print_r(func_get_args(), true));
            }

            switch ($query->getResultMode()) {
                case QueryBuilderResult::RESULT_SELECT_SINGLE:
                    return $sth->fetch();
                case QueryBuilderResult::RESULT_SELECT_MULTIPLE:
                    return $sth->fetchAll();
            }

            throw new DslSyntaxException('Result Mode ' . $query->getResultMode() . ' is not implemented', DATADO_ILLEGAL_RESULT_MODE);

        };

        $this->methods[$methodName] = \Closure::bind($findMethod, $this, get_class());
    }
758141
public function send($method_name, $params)
    {
        $this->token++;
        if ($this->token > 655360) {
            $this->token = 0;
        }
        if ($this->client->isConnected()) {
            $this->client->send($this->pack->pack(['m' => $method_name, 'p' => $params, 't' => $this->token]));
            return "[$this->ip][$method_name][$this->token]";
        } else {
            return false;
        }
    }
372173
public function run($name, array $arguments = [])
    {
        foreach ($this->getModules() as $module)
        {
            $instance = $this->getInstance($module);

            if ($this->hasMethod($instance, $name))
            {
                return call_user_func_array([$instance, $name], $arguments);
            }
        }

        throw new BadMethodCallException("Method {$name} does not exist");
    }
748119
protected Method resolveMethod (String name, Object[] arguments)
    {
        Class<?>[] ptypes = new Class<?>[arguments.length];
        for (int ii = 0; ii < arguments.length; ii++) {
            ptypes[ii] = arguments[ii] == null ?
                null : arguments[ii].getClass();
        }
        try {
            return _finder.findMethod(name, ptypes);
        } catch (Exception e) {
            return null;
        }
    }
926898
protected <T> T _execute(
                    final String string_url,
                    final HttpMethod method,
                    final RequestCallback callback,
                    final ResponseExtractor<T> extractor
                    )
    {
        _LOG_.debug( "HTTP: method = " + method + ", URL=" + string_url );

        URI  uri = null;
        try {
            URL  url = new URL( string_url );   //throws MalformedURLException
            uri = url.toURI();                  //throws URISyntaxException
        } catch (Exception ex) {
            _LOG_.error( "HTTP client error: " + ex );
            throw new HttpException( ex );
        }

        T  response = null;
        try {
            RestTemplate  rest = new RestTemplate();
            response = rest.execute( uri, method, callback, extractor );
                            //throws RestClientException
        } catch (Exception ex) {
            _LOG_.error( "HTTP client error: " + ex );
            throw new HttpException( ex );
        }

        return response;
    }
259881
private function matchRequestMethod(
        string $method = null,
        array $supported = null
    ) {
        if ($supported && !in_array($method, $supported)) {
            return false;
        }

        return true;
    }
1369282
def find_method(method_name)
      reg = Regexp.new(method_name.to_s, true)
      methods.sort.select { |meth| reg.match(meth) }
    end
395184
public <T> T execute(final String methodName, final Class<T> clazz, final Object... args) {
        return execute(methodName, clazz, true, args);
    }
485528
public function callHandler($handler_id, $method = 'data', array $arguments = array())
    {
        $handlers = $this->getHandlers();
        return Handler::call($handlers, $handler_id, $method, $arguments);
    }
982636
public static function checkMethodExists(
        Codebase $codebase,
        $method_id,
        CodeLocation $code_location,
        array $suppressed_issues,
        $calling_method_id = null
    ) {
        if ($codebase->methods->methodExists(
            $method_id,
            $calling_method_id,
            $calling_method_id !== $method_id ? $code_location : null,
            null,
            $code_location->file_path
        )) {
            return true;
        }

        if (IssueBuffer::accepts(
            new UndefinedMethod('Method ' . $method_id . ' does not exist', $code_location, $method_id),
            $suppressed_issues
        )) {
            return false;
        }

        return null;
    }