App\services\RESTfulService::__call PHP Method

__call() public method

Make an HTTP call to the external resource.
public __call ( string $method, array $args ) : object
$method string The HTTP method
$args array An array of parameters
return object
    public function __call($method, $args)
    {
        if (count($args) < 1) {
            throw new InvalidArgumentException('Magic request methods require a URI and optional options array');
        }
        $uri = $args[0];
        $opts = isset($args[1]) ? $args[1] : [];
        $appendKey = isset($args[2]) ? $args[2] : true;
        return $this->request($method, $uri, $appendKey, $opts);
    }