summaryrefslogtreecommitdiffstats
path: root/lib/private/AppFramework
diff options
context:
space:
mode:
authorChristoph Wurst <christoph@winzerhof-wurst.at>2020-04-09 13:53:40 +0200
committerChristoph Wurst <christoph@winzerhof-wurst.at>2020-04-09 13:54:22 +0200
commitafbd9c4e6ed834e713039f2cff88ba3eec03dadb (patch)
tree7d8721cf8fc0329d6b750db63798de67a162b090 /lib/private/AppFramework
parent19e97e86c69ab128191439d6a17dacb5a630cf98 (diff)
downloadnextcloud-server-afbd9c4e6ed834e713039f2cff88ba3eec03dadb.tar.gz
nextcloud-server-afbd9c4e6ed834e713039f2cff88ba3eec03dadb.zip
Unify function spacing to PSR2 recommendation
Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
Diffstat (limited to 'lib/private/AppFramework')
-rw-r--r--lib/private/AppFramework/App.php2
-rw-r--r--lib/private/AppFramework/DependencyInjection/DIContainer.php16
-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
-rw-r--r--lib/private/AppFramework/Utility/ControllerMethodReflector.php2
6 files changed, 17 insertions, 17 deletions
diff --git a/lib/private/AppFramework/App.php b/lib/private/AppFramework/App.php
index 2cbe623bb27..f7defda487e 100644
--- a/lib/private/AppFramework/App.php
+++ b/lib/private/AppFramework/App.php
@@ -199,7 +199,7 @@ class App {
* @param DIContainer $container an instance of a pimple container.
*/
public static function part(string $controllerName, string $methodName, array $urlParams,
- DIContainer $container){
+ DIContainer $container) {
$container['urlParams'] = $urlParams;
$controller = $container[$controllerName];
diff --git a/lib/private/AppFramework/DependencyInjection/DIContainer.php b/lib/private/AppFramework/DependencyInjection/DIContainer.php
index 6f4a48d8907..14898fadf95 100644
--- a/lib/private/AppFramework/DependencyInjection/DIContainer.php
+++ b/lib/private/AppFramework/DependencyInjection/DIContainer.php
@@ -83,7 +83,7 @@ class DIContainer extends SimpleContainer implements IAppContainer {
* @param array $urlParams
* @param ServerContainer|null $server
*/
- public function __construct($appName, $urlParams = [], ServerContainer $server = null){
+ public function __construct($appName, $urlParams = [], ServerContainer $server = null) {
parent::__construct();
$this['AppName'] = $appName;
$this['urlParams'] = $urlParams;
@@ -105,11 +105,11 @@ class DIContainer extends SimpleContainer implements IAppContainer {
/**
* Core services
*/
- $this->registerService(IOutput::class, function(){
+ $this->registerService(IOutput::class, function () {
return new Output($this->getServer()->getWebRoot());
});
- $this->registerService(Folder::class, function() {
+ $this->registerService(Folder::class, function () {
return $this->getServer()->getUserFolder();
});
@@ -117,7 +117,7 @@ class DIContainer extends SimpleContainer implements IAppContainer {
return $this->getServer()->getAppDataDir($c->query('AppName'));
});
- $this->registerService(IL10N::class, function($c) {
+ $this->registerService(IL10N::class, function ($c) {
return $this->getServer()->getL10N($c->query('AppName'));
});
@@ -156,14 +156,14 @@ class DIContainer extends SimpleContainer implements IAppContainer {
return $c->query(OC\GlobalScale\Config::class);
});
- $this->registerService('Protocol', function($c){
+ $this->registerService('Protocol', function ($c) {
/** @var \OC\Server $server */
$server = $c->query('ServerContainer');
$protocol = $server->getRequest()->getHttpProtocol();
return new Http($_SERVER, $protocol);
});
- $this->registerService('Dispatcher', function($c) {
+ $this->registerService('Dispatcher', function ($c) {
return new Dispatcher(
$c['Protocol'],
$c['MiddlewareDispatcher'],
@@ -182,7 +182,7 @@ class DIContainer extends SimpleContainer implements IAppContainer {
/**
* Middleware
*/
- $this->registerService('MiddlewareDispatcher', function(SimpleContainer $c) {
+ $this->registerService('MiddlewareDispatcher', function (SimpleContainer $c) {
$server = $this->getServer();
$dispatcher = new MiddlewareDispatcher();
@@ -376,7 +376,7 @@ class DIContainer extends SimpleContainer implements IAppContainer {
* @param string $serviceName e.g. 'OCA\Files\Capabilities'
*/
public function registerCapability($serviceName) {
- $this->query('OC\CapabilitiesManager')->registerCapability(function() use ($serviceName) {
+ $this->query('OC\CapabilitiesManager')->registerCapability(function () use ($serviceName) {
return $this->query($serviceName);
});
}
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();
diff --git a/lib/private/AppFramework/Utility/ControllerMethodReflector.php b/lib/private/AppFramework/Utility/ControllerMethodReflector.php
index ac7953e0457..31f1892772f 100644
--- a/lib/private/AppFramework/Utility/ControllerMethodReflector.php
+++ b/lib/private/AppFramework/Utility/ControllerMethodReflector.php
@@ -46,7 +46,7 @@ class ControllerMethodReflector implements IControllerMethodReflector {
* @param object $object an object or classname
* @param string $method the method which we want to inspect
*/
- public function reflect($object, string $method){
+ public function reflect($object, string $method) {
$reflection = new \ReflectionMethod($object, $method);
$docs = $reflection->getDocComment();