Skip to content
Permalink
Browse files

Use PSR7 response methods where possible.

In Component callbacks that return a response we can start using the
PSR7 methods as the event dispatcher passes the returned response up the
stack and eventually emits it.

Refs #9636
  • Loading branch information...
markstory committed Oct 27, 2016
1 parent 09497a4 commit 549cb2007b690163e3acaaa7b53a3c239ebe1a6e
@@ -366,8 +366,9 @@ protected function _unauthenticated(Controller $controller)
if (empty($this->_authenticateObjects)) {
$this->constructAuthenticate();
}
$response = $this->response;
$auth = end($this->_authenticateObjects);
$result = $auth->unauthenticated($this->request, $this->response);
$result = $auth->unauthenticated($this->request, $response);
if ($result !== null) {
return $result;
}
@@ -384,13 +385,10 @@ protected function _unauthenticated(Controller $controller)
$this->_config['ajaxLogin'],
$this->RequestHandler->ajaxLayout
);
$response->statusCode(403);
return $response;
return $response->withStatus(403);
}
$this->response->statusCode(403);
return $this->response;
return $response->withStatus(403);
}
/**
@@ -288,9 +288,8 @@ public function beforeRedirect(Event $event, $url, Response $response)
'query' => $query,
'cookies' => $request->cookies
]));
$response->statusCode(200);
return $response;
return $response->withStatus(200);
}
/**

0 comments on commit 549cb20

Please sign in to comment.
You can’t perform that action at this time.