chore(files_versions): Be extra-cautious to please psalm

Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
This commit is contained in:
Côme Chilliet 2026-05-12 10:26:17 +02:00
parent 84ba78fe6d
commit 3659b13cd2
No known key found for this signature in database
GPG key ID: A3E2F658B28C760A

View file

@ -793,6 +793,10 @@ class Storage {
$newInterval = false; // version checked so we can move to the next one
} else { // time to move on to the next interval
$interval++;
if ($interval > count(Storage::MAX_VERSIONS_PER_INTERVAL)) {
/* Should never happen, as last interval has -1 as nextInterval */
throw new \Exception('MAX_VERSIONS_PER_INTERVAL is malformed or there is a logic issue');
}
$step = Storage::MAX_VERSIONS_PER_INTERVAL[$interval]['step'];
$nextVersion = $prevTimestamp - $step;
if (Storage::MAX_VERSIONS_PER_INTERVAL[$interval]['intervalEndsAfter'] === -1) {