Call $method on every extension. Return the first not null
result. Throw exception if no result was returned.

@param string $method

@return self|null
196411
protected function firstNotNullResultOrFail($method)
    {
        $result = call_user_func_array([$this, 'firstNotNullResult'], func_get_args());
        if ($result === null) {
            throw new HandlerNotFoundException("No handler returned a value by $method");
        }
        return $result;
    }
968316
public function setMethod($method = self::GET)
	{
		if (in_array($method, $this->allowedMethods)) {
			$this->method = $method;
		} else {
			throw new RuntimeException('Invalid method setted.');
		}
		
		return $this;
	}
1167522
private function getRequestExtension($url, $method)
    {
        if (false === strpos(parse_url($url, PHP_URL_PATH), '.')) {
            if ('get' === strtolower($method)) {
                return sprintf('%s.jsonld', $url);
            }


            return sprintf('%s.json', $url);
        }

        return $url;
    }
85368
protected function callSoapMethod($method)
    {
        $args = func_get_args();
        array_shift($args);

        LogHandler::log($args, LoggerInterface::LEVEL_INFO, 'request_object');

        try {
            $response = call_user_func_array([$this->getSoapClient(), $method], $args);
            LogHandler::log($response, LoggerInterface::LEVEL_INFO, 'response_object');
        } catch (\SoapFault $e) {
            LogHandler::log(
                'SOAP ERROR (' . $e->faultcode . '): ' . $e->getMessage(),
                LoggerInterface::LEVEL_ERROR,
                'error'
            );
            throw new \SoapFault($e->faultcode, $e->faultstring);
        }

        $this->validateResponseCertificate();

        LogHandler::log(
            "Response certificate validated successfully",
            LoggerInterface::LEVEL_INFO,
            'response_certificate_validated'
        );

        return $response;
    }
926392
public function methodsEnd($method) {
        if (is_string($method)) {
            $method = array($method);
        }
        $this->rule = "end";
        $this->method = $method;
        return $this;
    }
930454
public function methodsStart($method) {
        if (is_string($method)) {
            $method = array($method);
        }
        $this->rule = "start";
        $this->method = $method;
        return $this;
    }
235317
public function setMethod($method) {

        if ( empty($method) || !is_string($method) ) throw new InvalidArgumentException("Invalid RPC method");

        $this->method = $method;

        return $this;

    }
730355
public function setMethod($method)
    {
        $method = strtolower($method);

        if (in_array($method, [Form::METHOD_GET, Form::METHOD_POST])) {
            $this->method = $method;
        } else {
            throw new \Exception('Incorrect method value given');
        }
        return $this;
    }
1116868
private function doCallback($method = null)
    {

        $callback = $method;
        if (is_null($callback)) {
            $callback = self::$METHOD_NAMES[$_POST['lti_message_type']];
        }
        if (method_exists($this, $callback)) {
            $result = $this->$callback();
        } else if (is_null($method) && $this->ok) {
            $this->ok = false;
            $this->reason = "Message type not supported: {$_POST['lti_message_type']}";
        }
        if ($this->ok && ($_POST['lti_message_type'] == 'ToolProxyRegistrationRequest')) {
            $this->consumer->save();
        }

    }
1136062
public function tryCall($method, $arguments)
    {
        if (isset($this->_hookTrait) && $ret = $this->hook('method-'.$method, $arguments)) {
            return $ret;
        }

        if (isset($this->_appScopeTrait) && isset($this->app->_hookTrait)) {
            array_unshift($arguments, $this);
            if ($ret = $this->app->hook('global-method-'.$method, $arguments)) {
                return $ret;
            }
        }
    }
903972
private function callMethod($instance, $method)
    {
        if (!method_exists($instance, $method) || !is_callable([$instance, $method])) {
            return false;
        }

        return call_user_func([$instance, $method]);
    }
1197654
private function checkMethodExist(string $method):int
    {
        if (in_array($method, $this->methodsReq)) {
            return (1);
        } else {
            new Server500(new \ArrayObject(array("explain" => "Unknown method $method for Allowed method request",
                "solution" => "Allowed methods request must be ".json_encode($this->methodsReq))));
        }
        return (0);
    }
1258088
protected function method($method)
    {
        if (strtolower($this->request->getMethod()) != strtolower($method)) {
            throw new MethodNotAllowedException('No matching method for HTTP method "'.$this->request->getMethod().'"');
        }
        return true;
    }
1157443
protected function callTraitMethod($method, array $args=[])
    {
        if (method_exists($this, $method)) {
            return call_user_func([$this, $method], ...$args);
        }
        return null;
    }
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);
        }
    }
744971
protected function getEndpoint($method)
    {
        $endpoint = 'inspect';
        $number = $this->getArgument("number");
        if (!is_null($number)) {
            $endpoint .= "/$number";
            $this->delArgument("number");
        }
        return $endpoint;
    }
1245252
public static function setMethod($method) {

		if(false === is_string($method)) {
  			return trigger_error(sprintf('Argument 1 passed to %s() must be of the type string, "%s" given', __METHOD__, gettype($method)), E_USER_ERROR);
  		}

		$_SERVER['REQUEST_METHOD'] = strtoupper($method);
	}