refactor(ServerVersion): Add missing type hinting

And mark the class as consumable and readonly.

Signed-off-by: Carl Schwan <carl.schwan@nextcloud.com>
This commit is contained in:
Carl Schwan 2025-11-17 10:02:47 +01:00
parent 76d878e7b9
commit d4356e6491

View file

@ -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;
}
}