X-Git-Url: https://git.m6w6.name/?p=m6w6%2Fseekat;a=blobdiff_plain;f=lib%2FAPI%2FCall%2FResult.php;fp=lib%2FAPI%2FCall%2FResult.php;h=22ce2efb29dbc4cf1ca17505107c88f00d8c7231;hp=8afc57e452e053a97c70adb9ce5d7691d7e38b18;hb=f4aa6beaf2e1f0dc9c877782cbbad5a989194517;hpb=626d8937c75f6d8fca463fa2b374f645068b2d6d diff --git a/lib/API/Call/Result.php b/lib/API/Call/Result.php index 8afc57e..22ce2ef 100644 --- a/lib/API/Call/Result.php +++ b/lib/API/Call/Result.php @@ -35,9 +35,7 @@ final class Result throw $e; } - $this->api = $this->api->with(compact("type", "data", "links")); - - return $this->api; + return $this->api = $this->api->with(compact("type", "data", "links")); } /** @@ -56,13 +54,11 @@ final class Result throw $e; } - if (($link = $response->getHeader("Link", Header::class))) { - $links = new API\Links($link); - } else { - $links = null; + if (!($link = $response->getHeader("Link", Header::class))) { + $link = null; } - return $links; + return new API\Links($link); } private function checkResponseType(Response $response) {