Skip to content

Commit f2e3142

Browse files
committed
chore(CurrentUser): Move to php types
Signed-off-by: Louis Chmn <louis@chmn.me>
1 parent 932d60e commit f2e3142

1 file changed

Lines changed: 7 additions & 11 deletions

File tree

lib/CurrentUser.php

Lines changed: 7 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -18,10 +18,10 @@
1818
class CurrentUser {
1919

2020
public function __construct(
21-
protected IUserSession $userSession,
22-
protected IRequest $request,
23-
protected IManager $shareManager,
24-
protected IFactory $l10nFactory,
21+
protected readonly IUserSession $userSession,
22+
protected readonly IRequest $request,
23+
protected readonly IManager $shareManager,
24+
protected readonly IFactory $l10nFactory,
2525
) {
2626
}
2727

@@ -31,9 +31,8 @@ public function getUser(): ?IUser {
3131

3232
/**
3333
* Get an identifier for the user, session or token
34-
* @return string
3534
*/
36-
public function getUserIdentifier() {
35+
public function getUserIdentifier(): string {
3736
$uid = $this->getUID();
3837
if ($uid !== null) {
3938
return $uid;
@@ -55,9 +54,8 @@ public function getUserIdentifier() {
5554

5655
/**
5756
* Get the current user id from the session
58-
* @return string|null
5957
*/
60-
public function getUID() {
58+
public function getUID(): string|null {
6159
$user = $this->userSession->getUser();
6260
if ($user instanceof IUser) {
6361
return $user->getUID();
@@ -67,9 +65,8 @@ public function getUID() {
6765

6866
/**
6967
* Get the current user cloud id from the session
70-
* @return string|null
7168
*/
72-
public function getCloudId() {
69+
public function getCloudId(): string|null {
7370
$user = $this->userSession->getUser();
7471
if ($user instanceof IUser) {
7572
return $user->getCloudId();
@@ -99,7 +96,6 @@ public function isPublicShareToken(): bool {
9996

10097
/**
10198
* Get the cloud ID from the sharing token
102-
* @return string|null
10399
*/
104100
protected function getCloudIDFromToken() {
105101
/** @psalm-suppress NoInterfaceProperties */

0 commit comments

Comments
 (0)