5 use AsyncInterop\Promise
;
22 function __construct(API
$api, string $call) {
27 function __invoke(array $args) : Promise
{
28 if ($this->api
->exists($this->call
."_url", $url)) {
29 $url = new Url(uri_template($url, (array)current($args)));
30 $promise = $this->api
->withUrl($url)->get(...$args);
32 $promise = $this->api
->{$this->call
}->get(...$args);