Skip to content

Commit 6bb46fd

Browse files
authored
Merge pull request #56491 from nextcloud/carl/type-version
refactor(ServerVersion): Add missing type hinting
2 parents a2a9550 + 33d2664 commit 6bb46fd

File tree

2 files changed

+7
-3
lines changed

2 files changed

+7
-3
lines changed

.github/workflows/lint-php-cs.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ jobs:
5555
- name: Set up php8.1
5656
uses: shivammathur/setup-php@ec406be512d7077f68eed36e63f4d91bc006edc4 # v2.35.4
5757
with:
58-
php-version: 8.1
58+
php-version: 8.2
5959
extensions: bz2, ctype, curl, dom, fileinfo, gd, iconv, intl, json, libxml, mbstring, openssl, pcntl, posix, session, simplexml, xmlreader, xmlwriter, zip, zlib, sqlite, pdo_sqlite
6060
coverage: none
6161
ini-file: development

lib/public/ServerVersion.php

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,15 @@
99

1010
namespace OCP;
1111

12+
use OCP\AppFramework\Attribute\Consumable;
13+
1214
/**
1315
* @since 31.0.0
1416
*/
15-
class ServerVersion {
17+
#[Consumable(since: '31.0.0')]
18+
readonly class ServerVersion {
1619

20+
/** @var int[] */
1721
private array $version;
1822
private string $versionString;
1923
private string $build;
@@ -59,6 +63,7 @@ public function getPatchVersion(): int {
5963
}
6064

6165
/**
66+
* @return int[]
6267
* @since 31.0.0
6368
*/
6469
public function getVersion(): array {
@@ -103,6 +108,5 @@ public function getHumanVersion(): string {
103108
$version .= ' Build:' . $build;
104109
}
105110
return $version;
106-
107111
}
108112
}

0 commit comments

Comments
 (0)