From 2d7424b56e43eca9efdc9abc49f226239c4f65df Mon Sep 17 00:00:00 2001 From: Meng Ye Date: Wed, 17 May 2017 10:30:38 +0800 Subject: [PATCH] fix Stream argument 1 type is wrong fix Argument 1 (stream) is string but \GuzzleHttp\Psr7\Stream::__construct() takes resource defined --- auth-server-auth-code.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/auth-server-auth-code.md b/auth-server-auth-code.md index 52948b70..51849ae4 100755 --- a/auth-server-auth-code.md +++ b/auth-server-auth-code.md @@ -126,7 +126,7 @@ $app->get('/authorize', function (ServerRequestInterface $request, ResponseInter } catch (\Exception $exception) { // Unknown exception - $body = new Stream('php://temp', 'r+'); + $body = new Stream(fopen('php://temp', 'r+')); $body->write($exception->getMessage()); return $response->withStatus(500)->withBody($body); @@ -152,7 +152,7 @@ $app->post('/access_token', function (ServerRequestInterface $request, ResponseI } catch (\Exception $exception) { // Unknown exception - $body = new Stream('php://temp', 'r+'); + $body = new Stream(fopen('php://temp', 'r+')); $body->write($exception->getMessage()); return $response->withStatus(500)->withBody($body); }