From d4356e64916e3a1c32d497d6fced91714c8c84c7 Mon Sep 17 00:00:00 2001 From: Carl Schwan Date: Mon, 17 Nov 2025 10:02:47 +0100 Subject: [PATCH] refactor(ServerVersion): Add missing type hinting And mark the class as consumable and readonly. Signed-off-by: Carl Schwan --- lib/public/ServerVersion.php | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/lib/public/ServerVersion.php b/lib/public/ServerVersion.php index d44452d42d0..e5df2515a86 100644 --- a/lib/public/ServerVersion.php +++ b/lib/public/ServerVersion.php @@ -9,11 +9,15 @@ declare(strict_types=1); namespace OCP; +use OCP\AppFramework\Attribute\Consumable; + /** * @since 31.0.0 */ -class ServerVersion { +#[Consumable(since: '31.0.0')] +readonly class ServerVersion { + /** @var int[] */ private array $version; private string $versionString; private string $build; @@ -59,6 +63,7 @@ class ServerVersion { } /** + * @return int[] * @since 31.0.0 */ public function getVersion(): array { @@ -103,6 +108,5 @@ class ServerVersion { $version .= ' Build:' . $build; } return $version; - } }