Passed
Push — master ( ca5481...570f3c )
by Joas
12:18 queued 11s
created
apps/workflowengine/lib/Service/RuleMatcher.php 1 patch
Spacing   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -87,28 +87,28 @@  discard block
 block discarded – undo
87 87
 	}
88 88
 
89 89
 	public function setOperation(IOperation $operation): void {
90
-		if($this->operation !== null) {
90
+		if ($this->operation !== null) {
91 91
 			throw new RuntimeException('This method must not be called more than once');
92 92
 		}
93 93
 		$this->operation = $operation;
94 94
 	}
95 95
 
96 96
 	public function setEntity(IEntity $entity): void {
97
-		if($this->entity !== null) {
97
+		if ($this->entity !== null) {
98 98
 			throw new RuntimeException('This method must not be called more than once');
99 99
 		}
100 100
 		$this->entity = $entity;
101 101
 	}
102 102
 
103 103
 	public function getEntity(): IEntity {
104
-		if($this->entity === null) {
104
+		if ($this->entity === null) {
105 105
 			throw new \LogicException('Entity was not set yet');
106 106
 		}
107 107
 		return $this->entity;
108 108
 	}
109 109
 
110 110
 	public function getFlows(bool $returnFirstMatchingOperationOnly = true): array {
111
-		if(!$this->operation) {
111
+		if (!$this->operation) {
112 112
 			throw new RuntimeException('Operation is not set');
113 113
 		}
114 114
 		return $this->getMatchingOperations(get_class($this->operation), $returnFirstMatchingOperationOnly);
@@ -117,7 +117,7 @@  discard block
 block discarded – undo
117 117
 	public function getMatchingOperations(string $class, bool $returnFirstMatchingOperationOnly = true): array {
118 118
 		$scopes[] = new ScopeContext(IManager::SCOPE_ADMIN);
119 119
 		$user = $this->session->getUser();
120
-		if($user !== null) {
120
+		if ($user !== null) {
121 121
 			$scopes[] = new ScopeContext(IManager::SCOPE_USER, $user->getUID());
122 122
 		}
123 123
 
@@ -133,7 +133,7 @@  discard block
 block discarded – undo
133 133
 			$operations = array_merge($operations, $this->manager->getOperations($class, $scope));
134 134
 		}
135 135
 
136
-		if($this->entity instanceof IEntity) {
136
+		if ($this->entity instanceof IEntity) {
137 137
 			/** @var ScopeContext[] $additionalScopes */
138 138
 			$additionalScopes = $this->manager->getAllConfiguredScopesForOperation($class);
139 139
 			foreach ($additionalScopes as $hash => $scopeCandidate) {
@@ -187,7 +187,7 @@  discard block
 block discarded – undo
187 187
 		$ctx
188 188
 			->setEntity($this->entity)
189 189
 			->setOperation($this->operation);
190
-		if(!empty($matches)) {
190
+		if (!empty($matches)) {
191 191
 			$ctx->setConfiguration($matches);
192 192
 			$this->logger->logRunAll($ctx);
193 193
 		} else {
@@ -215,11 +215,11 @@  discard block
 block discarded – undo
215 215
 			}
216 216
 			$checkInstance->setFileInfo($this->fileInfo['storage'], $this->fileInfo['path'], $this->fileInfo['isDir']);
217 217
 		} elseif ($checkInstance instanceof IEntityCheck) {
218
-			foreach($this->contexts as $entityInfo) {
218
+			foreach ($this->contexts as $entityInfo) {
219 219
 				list($entity, $subject) = $entityInfo;
220 220
 				$checkInstance->setEntitySubject($entity, $subject);
221 221
 			}
222
-		} else if(!$checkInstance instanceof ICheck) {
222
+		} else if (!$checkInstance instanceof ICheck) {
223 223
 			// Check is invalid
224 224
 			throw new \UnexpectedValueException($this->l->t('Check %s is invalid or does not exist', $check['class']));
225 225
 		}
Please login to merge, or discard this patch.