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/Entity/File.php | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) (limited to 'apps/workflowengine/lib/Entity') diff --git a/apps/workflowengine/lib/Entity/File.php b/apps/workflowengine/lib/Entity/File.php index 78178ff759d..4f98a3e5cad 100644 --- a/apps/workflowengine/lib/Entity/File.php +++ b/apps/workflowengine/lib/Entity/File.php @@ -46,7 +46,6 @@ use OCP\WorkflowEngine\IEntity; use OCP\WorkflowEngine\IRuleMatcher; class File implements IEntity, IDisplayText, IUrl { - private const EVENT_NAMESPACE = '\OCP\Files::'; /** @var IL10N */ @@ -125,7 +124,7 @@ class File implements IEntity, IDisplayText, IUrl { public function isLegitimatedForUserId(string $uid): bool { try { $node = $this->getNode(); - if($node->getOwner()->getUID() === $uid) { + if ($node->getOwner()->getUID() === $uid) { return true; } $acl = $this->shareManager->getAccessList($node, true, true); @@ -192,19 +191,19 @@ class File implements IEntity, IDisplayText, IUrl { return $this->l10n->t('%s copied %s', $options); case MapperEvent::EVENT_ASSIGN: $tagNames = []; - if($this->event instanceof MapperEvent) { + if ($this->event instanceof MapperEvent) { $tagIDs = $this->event->getTags(); $tagObjects = $this->tagManager->getTagsByIds($tagIDs); foreach ($tagObjects as $systemTag) { /** @var ISystemTag $systemTag */ - if($systemTag->isUserVisible()) { + if ($systemTag->isUserVisible()) { $tagNames[] = $systemTag->getName(); } } } $filename = array_pop($options); $tagString = implode(', ', $tagNames); - if($tagString === '') { + if ($tagString === '') { return ''; } array_push($options, $tagString, $filename); -- cgit v1.2.3