Skip to content

Commit

Permalink
Code formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
cundd committed Nov 8, 2019
1 parent 3d15f6b commit c130d7a
Showing 1 changed file with 8 additions and 10 deletions.
18 changes: 8 additions & 10 deletions Classes/Dispatcher.php
Original file line number Diff line number Diff line change
Expand Up @@ -257,7 +257,14 @@ private function dispatchInternal(RestRequestInterface $request): ResponseInterf
switch (true) {
case $access->isAllowed():
case $access->isAuthorized():
break;
$newResponse = $this->getCachedResponseOrCallHandler($request);

$this->logger->logResponse(
'response: ' . $newResponse->getStatusCode(),
['response' => (string)$newResponse->getBody()]
);

return $newResponse;

case $access->isUnauthorized():
return $this->responseFactory->createErrorResponse('Unauthorized', 401, $request);
Expand All @@ -266,15 +273,6 @@ private function dispatchInternal(RestRequestInterface $request): ResponseInterf
default:
return $this->responseFactory->createErrorResponse('Forbidden', 403, $request);
}

$newResponse = $this->getCachedResponseOrCallHandler($request);

$this->logger->logResponse(
'response: ' . $newResponse->getStatusCode(),
['response' => (string)$newResponse->getBody()]
);

return $newResponse;
}

/**
Expand Down

0 comments on commit c130d7a

Please sign in to comment.