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

Signed-off-by: Daniel Kesselberg <mail@danielkesselberg.de>
This commit is contained in:
Daniel Kesselberg 2020-03-17 15:23:59 +01:00
parent 458ec33aa2
commit b3780bcedd
No known key found for this signature in database
GPG Key ID: 36E3664E099D0614
2 changed files with 5 additions and 1 deletions

View File

@ -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])) {

View File

@ -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;
} }