mirror of
https://github.com/elyby/oauth2-server.git
synced 2024-12-28 16:00:24 +05:30
No need to use Zend\Diactoros\Stream
This commit is contained in:
parent
bd12c8b1a9
commit
15b6506644
@ -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
|
||||
}
|
||||
|
||||
|
@ -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
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user