From 8f724bb7208093cd1580c3858a8c4d066a789fa7 Mon Sep 17 00:00:00 2001 From: Alex Bilbie Date: Fri, 15 Jan 2016 18:32:53 +0000 Subject: [PATCH] Fix immutability issues --- src/Exception/OAuthServerException.php | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/Exception/OAuthServerException.php b/src/Exception/OAuthServerException.php index f97e3b5a..982c8f73 100644 --- a/src/Exception/OAuthServerException.php +++ b/src/Exception/OAuthServerException.php @@ -226,14 +226,12 @@ class OAuthServerException extends \Exception } foreach ($headers as $header => $content) { - $response->withHeader($header, $content); + $response = $response->withHeader($header, $content); } - $response + return $response ->withStatus($this->getHttpStatusCode()) ->getBody()->write(json_encode($payload)); - - return $response; } /**