Skip to content

Commit

Permalink
Annotate $additionalScopes so the IDE knows what type $scopeCandidate…
Browse files Browse the repository at this point in the history
… is.

Signed-off-by: Daniel Kesselberg <mail@danielkesselberg.de>
  • Loading branch information
kesselb committed Mar 17, 2020
1 parent 458ec33 commit b3780bc
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
4 changes: 4 additions & 0 deletions apps/workflowengine/lib/Manager.php
Original file line number Diff line number Diff line change
Expand Up @@ -163,6 +163,10 @@ public function getAllConfiguredEvents() {
return $operations;
}

/**
* @param string $operationClass
* @return ScopeContext[]
*/
public function getAllConfiguredScopesForOperation(string $operationClass): array {
static $scopesByOperation = [];
if (isset($scopesByOperation[$operationClass])) {
Expand Down
2 changes: 1 addition & 1 deletion apps/workflowengine/lib/Service/RuleMatcher.php
Original file line number Diff line number Diff line change
Expand Up @@ -134,9 +134,9 @@ public function getMatchingOperations(string $class, bool $returnFirstMatchingOp
}

if($this->entity instanceof IEntity) {
/** @var ScopeContext[] $additionalScopes */
$additionalScopes = $this->manager->getAllConfiguredScopesForOperation($class);
foreach ($additionalScopes as $hash => $scopeCandidate) {
/** @var ScopeContext $scopeCandidate */
if ($scopeCandidate->getScope() !== IManager::SCOPE_USER || in_array($scopeCandidate, $scopes)) {
continue;
}
Expand Down

0 comments on commit b3780bc

Please sign in to comment.