projects
/
m6w6
/
seekat
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
|
github
raw
|
inline
| side by side
update to PHP-8.1
[m6w6/seekat]
/
lib
/
API
/
Call.php
diff --git
a/lib/API/Call.php
b/lib/API/Call.php
index 7eba2a80b7fbfb76f6b7748c728c06797410c357..a913bdaffb6c49c4f7031576342af864960a2f84 100644
(file)
--- a/
lib/API/Call.php
+++ b/
lib/API/Call.php
@@
-2,31
+2,16
@@
namespace seekat\API;
namespace seekat\API;
-use AsyncInterop\Promise;
use http\Url;
use seekat\API;
use http\Url;
use seekat\API;
-use seekat\Exception;
-final class Call
-{
- /**
- * @var API
- */
- private $api;
-
- /**
- * @var string
- */
- private $call;
-
- function __construct(API $api, string $call) {
- $this->api = $api;
- $this->call = $call;
+final class Call {
+ function __construct(private readonly API $api, private readonly string $call) {
}
}
- function __invoke(array $args)
: Promise
{
+ function __invoke(array $args) {
if ($this->api->exists($this->call."_url", $url)) {
if ($this->api->exists($this->call."_url", $url)) {
- $url = new Url(uri_template($url, (array)current($args)));
+ $url = new Url(uri_template($url, (array)
current($args)));
$promise = $this->api->withUrl($url)->get(...$args);
} else {
$promise = $this->api->{$this->call}->get(...$args);
$promise = $this->api->withUrl($url)->get(...$args);
} else {
$promise = $this->api->{$this->call}->get(...$args);