]> source.dussan.org Git - nextcloud-server.git/commitdiff
Annotate $additionalScopes so the IDE knows what type $scopeCandidate is. 20003/head
authorDaniel Kesselberg <mail@danielkesselberg.de>
Tue, 17 Mar 2020 14:23:59 +0000 (15:23 +0100)
committerDaniel Kesselberg <mail@danielkesselberg.de>
Tue, 17 Mar 2020 14:27:22 +0000 (15:27 +0100)
Signed-off-by: Daniel Kesselberg <mail@danielkesselberg.de>
apps/workflowengine/lib/Manager.php
apps/workflowengine/lib/Service/RuleMatcher.php

index 2818238081ea4bd70d1f3086f5af2d404510d7c3..1829bee300f460356fb9746639499ce42d4635ad 100644 (file)
@@ -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])) {
index 99a5db8a9d06bbbc8b11afe7ad38a51f98e1aa95..70c40e1251aff365e5b78873d8a28dc1d6fbe937 100644 (file)
@@ -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;
                                }