Skip to content
Snippets Groups Projects
Unverified Commit b3780bce authored by Daniel Kesselberg's avatar Daniel Kesselberg
Browse files

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

parent 458ec33a
No related branches found
No related tags found
No related merge requests found
...@@ -163,6 +163,10 @@ class Manager implements IManager { ...@@ -163,6 +163,10 @@ class Manager implements IManager {
return $operations; return $operations;
} }
/**
* @param string $operationClass
* @return ScopeContext[]
*/
public function getAllConfiguredScopesForOperation(string $operationClass): array { public function getAllConfiguredScopesForOperation(string $operationClass): array {
static $scopesByOperation = []; static $scopesByOperation = [];
if (isset($scopesByOperation[$operationClass])) { if (isset($scopesByOperation[$operationClass])) {
......
...@@ -134,9 +134,9 @@ class RuleMatcher implements IRuleMatcher { ...@@ -134,9 +134,9 @@ class RuleMatcher implements IRuleMatcher {
} }
if($this->entity instanceof IEntity) { if($this->entity instanceof IEntity) {
/** @var ScopeContext[] $additionalScopes */
$additionalScopes = $this->manager->getAllConfiguredScopesForOperation($class); $additionalScopes = $this->manager->getAllConfiguredScopesForOperation($class);
foreach ($additionalScopes as $hash => $scopeCandidate) { foreach ($additionalScopes as $hash => $scopeCandidate) {
/** @var ScopeContext $scopeCandidate */
if ($scopeCandidate->getScope() !== IManager::SCOPE_USER || in_array($scopeCandidate, $scopes)) { if ($scopeCandidate->getScope() !== IManager::SCOPE_USER || in_array($scopeCandidate, $scopes)) {
continue; continue;
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment