No need to use Zend\Diactoros\Stream

This commit is contained in:
Alex Bilbie 2016-03-17 11:21:53 +00:00
parent bd12c8b1a9
commit 15b6506644
2 changed files with 4 additions and 10 deletions

View File

@ -6,7 +6,6 @@ use League\OAuth2\Server\Exception\OAuthServerException;
use League\OAuth2\Server\Server;
use Psr\Http\Message\ResponseInterface;
use Psr\Http\Message\ServerRequestInterface;
use Zend\Diactoros\Stream;
class AuthenticationServerMiddleware
{
@ -40,10 +39,8 @@ class AuthenticationServerMiddleware
return $exception->generateHttpResponse($response);
// @codeCoverageIgnoreStart
} catch (\Exception $exception) {
$body = new Stream('php://temp', 'r+');
$body->write($exception->getMessage());
return $response->withStatus(500)->withBody($body);
$response->getBody()->write($exception->getMessage());
return $response->withStatus(500);
// @codeCoverageIgnoreEnd
}

View File

@ -6,7 +6,6 @@ use League\OAuth2\Server\Exception\OAuthServerException;
use League\OAuth2\Server\Server;
use Psr\Http\Message\ResponseInterface;
use Psr\Http\Message\ServerRequestInterface;
use Zend\Diactoros\Stream;
class ResourceServerMiddleware
{
@ -40,10 +39,8 @@ class ResourceServerMiddleware
return $exception->generateHttpResponse($response);
// @codeCoverageIgnoreStart
} catch (\Exception $exception) {
$body = new Stream('php://temp', 'r+');
$body->write($exception->getMessage());
return $response->withStatus(500)->withBody($body);
$response->getBody()->write($exception->getMessage());
return $response->withStatus(500);
// @codeCoverageIgnoreEnd
}