Browse Source

Fix comments

Mischa ter Smitten 5 years ago
parent
commit
056373e5e7

+ 1 - 1
src/Controller/Component/RequestHandlerComponent.php

@@ -287,7 +287,7 @@ class RequestHandlerComponent extends Component
         }
         /** @var \Cake\Controller\Controller $controller */
         $controller = $event->getSubject();
-        $response->withStringBody($controller->requestAction($url, [
+        $response = $response->withStringBody($controller->requestAction($url, [
             'return',
             'bare' => false,
             'environment' => [

+ 1 - 1
src/Http/Client/Response.php

@@ -560,7 +560,7 @@ class Response extends Message implements ResponseInterface
      * For example to get the json data as an object:
      *
      * ```
-     * $body = $response->getStringBody('json_decode');
+     * $body = $response->getJson();
      * ```
      *
      * @param callable|null $parser The callback to use to decode

+ 1 - 1
src/Http/Response.php

@@ -624,7 +624,7 @@ class Response implements ResponseInterface
         );
 
         if (in_array($this->_status, [304, 204])) {
-            $this->withStringBody('');
+            $this = $this->withStringBody('');
         }
     }