From 3659b13cd26860fb0ba0de9743470b93f073a585 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=B4me=20Chilliet?= Date: Tue, 12 May 2026 10:26:17 +0200 Subject: [PATCH] chore(files_versions): Be extra-cautious to please psalm MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Côme Chilliet --- apps/files_versions/lib/Storage.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/apps/files_versions/lib/Storage.php b/apps/files_versions/lib/Storage.php index 538ae24e09b..01e152a577f 100644 --- a/apps/files_versions/lib/Storage.php +++ b/apps/files_versions/lib/Storage.php @@ -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) {