From caff1023ea72bb2ea94130e18a2a6e2ccf819e5f Mon Sep 17 00:00:00 2001 From: Christoph Wurst Date: Fri, 10 Apr 2020 14:19:56 +0200 Subject: Format control structures, classes, methods and function To continue this formatting madness, here's a tiny patch that adds unified formatting for control structures like if and loops as well as classes, their methods and anonymous functions. This basically forces the constructs to start on the same line. This is not exactly what PSR2 wants, but I think we can have a few exceptions with "our" style. The starting of braces on the same line is pracrically standard for our code. This also removes and empty lines from method/function bodies at the beginning and end. Signed-off-by: Christoph Wurst --- apps/workflowengine/lib/Controller/AWorkflowController.php | 6 +++--- apps/workflowengine/lib/Controller/GlobalWorkflowsController.php | 2 +- apps/workflowengine/lib/Controller/UserWorkflowsController.php | 5 ++--- 3 files changed, 6 insertions(+), 7 deletions(-) (limited to 'apps/workflowengine/lib/Controller') diff --git a/apps/workflowengine/lib/Controller/AWorkflowController.php b/apps/workflowengine/lib/Controller/AWorkflowController.php index 767ae79c5fd..6d109f7dccf 100644 --- a/apps/workflowengine/lib/Controller/AWorkflowController.php +++ b/apps/workflowengine/lib/Controller/AWorkflowController.php @@ -112,7 +112,7 @@ abstract class AWorkflowController extends OCSController { throw new OCSBadRequestException($e->getMessage(), $e); } catch (\DomainException $e) { throw new OCSForbiddenException($e->getMessage(), $e); - } catch(DBALException $e) { + } catch (DBALException $e) { throw new OCSException('An internal error occurred', $e->getCode(), $e); } } @@ -139,7 +139,7 @@ abstract class AWorkflowController extends OCSController { throw new OCSBadRequestException($e->getMessage(), $e); } catch (\DomainException $e) { throw new OCSForbiddenException($e->getMessage(), $e); - } catch(DBALException $e) { + } catch (DBALException $e) { throw new OCSException('An internal error occurred', $e->getCode(), $e); } } @@ -157,7 +157,7 @@ abstract class AWorkflowController extends OCSController { throw new OCSBadRequestException($e->getMessage(), $e); } catch (\DomainException $e) { throw new OCSForbiddenException($e->getMessage(), $e); - } catch(DBALException $e) { + } catch (DBALException $e) { throw new OCSException('An internal error occurred', $e->getCode(), $e); } } diff --git a/apps/workflowengine/lib/Controller/GlobalWorkflowsController.php b/apps/workflowengine/lib/Controller/GlobalWorkflowsController.php index 45930c34c5b..6641155f032 100644 --- a/apps/workflowengine/lib/Controller/GlobalWorkflowsController.php +++ b/apps/workflowengine/lib/Controller/GlobalWorkflowsController.php @@ -34,7 +34,7 @@ class GlobalWorkflowsController extends AWorkflowController { private $scopeContext; protected function getScopeContext(): ScopeContext { - if($this->scopeContext === null) { + if ($this->scopeContext === null) { $this->scopeContext = new ScopeContext(IManager::SCOPE_ADMIN); } return $this->scopeContext; diff --git a/apps/workflowengine/lib/Controller/UserWorkflowsController.php b/apps/workflowengine/lib/Controller/UserWorkflowsController.php index 226746a2264..c3884b61979 100644 --- a/apps/workflowengine/lib/Controller/UserWorkflowsController.php +++ b/apps/workflowengine/lib/Controller/UserWorkflowsController.php @@ -105,14 +105,13 @@ class UserWorkflowsController extends AWorkflowController { * @throws OCSForbiddenException */ protected function getScopeContext(): ScopeContext { - if($this->scopeContext === null) { + if ($this->scopeContext === null) { $user = $this->session->getUser(); - if(!$user || !$this->manager->isUserScopeEnabled()) { + if (!$user || !$this->manager->isUserScopeEnabled()) { throw new OCSForbiddenException('User not logged in'); } $this->scopeContext = new ScopeContext(IManager::SCOPE_USER, $user->getUID()); } return $this->scopeContext; } - } -- cgit v1.2.3