Annotate $additionalScopes so the IDE knows what type $scopeCandidate is.

Signed-off-by: Daniel Kesselberg <mail@danielkesselberg.de>
pull/20003/head
Daniel Kesselberg 6 years ago
parent 458ec33aa2
commit b3780bcedd
No known key found for this signature in database
GPG Key ID: 36E3664E099D0614
  1. 4
      apps/workflowengine/lib/Manager.php
  2. 2
      apps/workflowengine/lib/Service/RuleMatcher.php

@ -163,6 +163,10 @@ class Manager implements IManager {
return $operations;
}
/**
* @param string $operationClass
* @return ScopeContext[]
*/
public function getAllConfiguredScopesForOperation(string $operationClass): array {
static $scopesByOperation = [];
if (isset($scopesByOperation[$operationClass])) {

@ -134,9 +134,9 @@ class RuleMatcher implements IRuleMatcher {
}
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;
}

Loading…
Cancel
Save