summaryrefslogtreecommitdiffstats
path: root/lib/private/AppFramework/Middleware
diff options
context:
space:
mode:
authorChristoph Wurst <ChristophWurst@users.noreply.github.com>2020-04-09 15:53:09 +0200
committerGitHub <noreply@github.com>2020-04-09 15:53:09 +0200
commitc56a273b39186c509c57ef6bec221d3c4e3d81d3 (patch)
treeb2e4095e763874699646c2c90e41785c99b6f247 /lib/private/AppFramework/Middleware
parentf0dd71ccd266ede38114d25be035abb3f2661fc8 (diff)
parentafbd9c4e6ed834e713039f2cff88ba3eec03dadb (diff)
downloadnextcloud-server-c56a273b39186c509c57ef6bec221d3c4e3d81d3.tar.gz
nextcloud-server-c56a273b39186c509c57ef6bec221d3c4e3d81d3.zip
Merge pull request #20383 from nextcloud/techdebt/function-spacing
Unify function spacing to PSR2 recommendation
Diffstat (limited to 'lib/private/AppFramework/Middleware')
-rw-r--r--lib/private/AppFramework/Middleware/MiddlewareDispatcher.php6
-rw-r--r--lib/private/AppFramework/Middleware/Security/CORSMiddleware.php6
-rw-r--r--lib/private/AppFramework/Middleware/SessionMiddleware.php2
3 files changed, 7 insertions, 7 deletions
diff --git a/lib/private/AppFramework/Middleware/MiddlewareDispatcher.php b/lib/private/AppFramework/Middleware/MiddlewareDispatcher.php
index 10cb9249a51..47b9a62af81 100644
--- a/lib/private/AppFramework/Middleware/MiddlewareDispatcher.php
+++ b/lib/private/AppFramework/Middleware/MiddlewareDispatcher.php
@@ -55,7 +55,7 @@ class MiddlewareDispatcher {
/**
* Constructor
*/
- public function __construct(){
+ public function __construct() {
$this->middlewares = [];
$this->middlewareCounter = 0;
}
@@ -65,7 +65,7 @@ class MiddlewareDispatcher {
* Adds a new middleware
* @param Middleware $middleWare the middleware which will be added
*/
- public function registerMiddleware(Middleware $middleWare){
+ public function registerMiddleware(Middleware $middleWare) {
$this->middlewares[] = $middleWare;
}
@@ -87,7 +87,7 @@ class MiddlewareDispatcher {
* @param string $methodName the name of the method that will be called on
* the controller
*/
- public function beforeController(Controller $controller, string $methodName){
+ public function beforeController(Controller $controller, string $methodName) {
// we need to count so that we know which middlewares we have to ask in
// case there is an exception
$middlewareCount = \count($this->middlewares);
diff --git a/lib/private/AppFramework/Middleware/Security/CORSMiddleware.php b/lib/private/AppFramework/Middleware/Security/CORSMiddleware.php
index 1883756954b..acfbab25ed4 100644
--- a/lib/private/AppFramework/Middleware/Security/CORSMiddleware.php
+++ b/lib/private/AppFramework/Middleware/Security/CORSMiddleware.php
@@ -80,7 +80,7 @@ class CORSMiddleware extends Middleware {
* @throws SecurityException
* @since 6.0.0
*/
- public function beforeController($controller, $methodName){
+ public function beforeController($controller, $methodName) {
// ensure that @CORS annotated API routes are not used in conjunction
// with session authentication since this enables CSRF attack vectors
if ($this->reflector->hasAnnotation('CORS') &&
@@ -110,7 +110,7 @@ class CORSMiddleware extends Middleware {
* @return Response a Response object
* @throws SecurityException
*/
- public function afterController($controller, $methodName, Response $response){
+ public function afterController($controller, $methodName, Response $response) {
// only react if its a CORS request and if the request sends origin and
if(isset($this->request->server['HTTP_ORIGIN']) &&
@@ -143,7 +143,7 @@ class CORSMiddleware extends Middleware {
* @throws \Exception the passed in exception if it can't handle it
* @return Response a Response object or null in case that the exception could not be handled
*/
- public function afterException($controller, $methodName, \Exception $exception){
+ public function afterException($controller, $methodName, \Exception $exception) {
if($exception instanceof SecurityException){
$response = new JSONResponse(['message' => $exception->getMessage()]);
if($exception->getCode() !== 0) {
diff --git a/lib/private/AppFramework/Middleware/SessionMiddleware.php b/lib/private/AppFramework/Middleware/SessionMiddleware.php
index 1f4ba123104..d2787dde745 100644
--- a/lib/private/AppFramework/Middleware/SessionMiddleware.php
+++ b/lib/private/AppFramework/Middleware/SessionMiddleware.php
@@ -62,7 +62,7 @@ class SessionMiddleware extends Middleware {
* @param Response $response
* @return Response
*/
- public function afterController($controller, $methodName, Response $response){
+ public function afterController($controller, $methodName, Response $response) {
$useSession = $this->reflector->hasAnnotation('UseSession');
if ($useSession) {
$this->session->close();