X-Git-Url: https://git.m6w6.name/?p=m6w6%2Fseekat;a=blobdiff_plain;f=lib%2FAPI%2FLinks%2Ffunctions.php;h=f740851e9de6bc00131750539a63751142a89763;hp=eb9b495adedb11354d95b4b44e2cb1f1fb3f61da;hb=e368287b3cd2dd40945ac8d1a1946bc32268007d;hpb=f4aa6beaf2e1f0dc9c877782cbbad5a989194517 diff --git a/lib/API/Links/functions.php b/lib/API/Links/functions.php index eb9b495..f740851 100644 --- a/lib/API/Links/functions.php +++ b/lib/API/Links/functions.php @@ -17,7 +17,7 @@ function first(API $api, Cache\Service $cache = null) : Promise { if ($links && ($first = $links->getFirst())) { return $api->withUrl($first)->get(null, null, $cache); } - return Future\reject($api->getFuture(), $links); + return Future\resolve($api->getFuture(), null); } /** @@ -30,7 +30,7 @@ function prev(API $api, Cache\Service $cache = null) : Promise { if ($links && ($prev = $links->getPrev())) { return $api->withUrl($prev)->get(null, null, $cache); } - return Future\reject($api->getFuture(), $links); + return Future\resolve($api->getFuture(), null); } /** @@ -43,7 +43,7 @@ function next(API $api, Cache\Service $cache = null) : Promise { if ($links && ($next = $links->getNext())) { return $api->withUrl($next)->get(null, null, $cache); } - return Future\reject($api->getFuture(), $links); + return Future\resolve($api->getFuture(), null); } /** @@ -56,6 +56,6 @@ function last(API $api, Cache\Service $cache = null) : Promise { if ($links && ($last = $links->getLast())) { return $api->withUrl($last)->get(null, null, $cache); } - return Future\reject($api->getFuture(), $links); + return Future\resolve($api->getFuture(), null); }