basic async-interop support; generator consumer missing
[m6w6/seekat] / lib / API / Call / Result.php
index 8afc57e452e053a97c70adb9ce5d7691d7e38b18..22ce2efb29dbc4cf1ca17505107c88f00d8c7231 100644 (file)
@@ -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) {