aboutsummaryrefslogtreecommitdiffstats
path: root/apps/workflowengine
diff options
context:
space:
mode:
authorCarl Schwan <carl@carlschwan.eu>2022-05-03 11:15:24 +0200
committerCarl Schwan <carl@carlschwan.eu>2022-05-12 15:06:18 +0200
commitec6b83cc1891214c7fa3a236626807b4335f9a2f (patch)
treeb5f12993172528ddec15b7b8ae6a09a0080fedd7 /apps/workflowengine
parent5a0b28d603e142051967175f023b698ff7e262db (diff)
downloadnextcloud-server-ec6b83cc1891214c7fa3a236626807b4335f9a2f.tar.gz
nextcloud-server-ec6b83cc1891214c7fa3a236626807b4335f9a2f.zip
Add stricter psalm type for CappedMemoryCache
Signed-off-by: Carl Schwan <carl@carlschwan.eu>
Diffstat (limited to 'apps/workflowengine')
-rw-r--r--apps/workflowengine/lib/Manager.php9
1 files changed, 5 insertions, 4 deletions
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<int[]> */
+ 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);