From ec6b83cc1891214c7fa3a236626807b4335f9a2f Mon Sep 17 00:00:00 2001 From: Carl Schwan Date: Tue, 3 May 2022 11:15:24 +0200 Subject: Add stricter psalm type for CappedMemoryCache Signed-off-by: Carl Schwan --- apps/workflowengine/lib/Manager.php | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'apps/workflowengine') diff --git a/apps/workflowengine/lib/Manager.php b/apps/workflowengine/lib/Manager.php index 34dbf507b91..f6c3e3086c2 100644 --- a/apps/workflowengine/lib/Manager.php +++ b/apps/workflowengine/lib/Manager.php @@ -109,8 +109,8 @@ class Manager implements IManager { /** @var ILogger */ protected $logger; - /** @var CappedMemoryCache */ - protected $operationsByScope = []; + /** @var CappedMemoryCache */ + protected CappedMemoryCache $operationsByScope; /** @var IUserSession */ protected $session; @@ -350,10 +350,11 @@ class Manager implements IManager { $qb->setParameters(['scope' => $scopeContext->getScope(), 'scopeId' => $scopeContext->getScopeId()]); $result = $qb->execute(); - $this->operationsByScope[$scopeContext->getHash()] = []; + $operations = []; while (($opId = $result->fetchOne()) !== false) { - $this->operationsByScope[$scopeContext->getHash()][] = (int)$opId; + $operations[] = (int)$opId; } + $this->operationsByScope[$scopeContext->getHash()] = $operations; $result->closeCursor(); return in_array($id, $this->operationsByScope[$scopeContext->getHash()], true); -- cgit v1.2.3