diff options
Diffstat (limited to 'apps/user_status/lib/Connector')
-rw-r--r-- | apps/user_status/lib/Connector/UserStatus.php | 24 | ||||
-rw-r--r-- | apps/user_status/lib/Connector/UserStatusProvider.php | 8 |
2 files changed, 14 insertions, 18 deletions
diff --git a/apps/user_status/lib/Connector/UserStatus.php b/apps/user_status/lib/Connector/UserStatus.php index 7fbfd62f223..04467a99e5e 100644 --- a/apps/user_status/lib/Connector/UserStatus.php +++ b/apps/user_status/lib/Connector/UserStatus.php @@ -29,21 +29,19 @@ class UserStatus implements IUserStatus { /** @var DateTimeImmutable|null */ private $clearAt; - /** @var Db\UserStatus */ - private $internalStatus; - - public function __construct(Db\UserStatus $status) { - $this->internalStatus = $status; - $this->userId = $status->getUserId(); - $this->status = $status->getStatus(); - $this->message = $status->getCustomMessage(); - $this->icon = $status->getCustomIcon(); - - if ($status->getStatus() === IUserStatus::INVISIBLE) { + public function __construct( + private Db\UserStatus $internalStatus, + ) { + $this->userId = $this->internalStatus->getUserId(); + $this->status = $this->internalStatus->getStatus(); + $this->message = $this->internalStatus->getCustomMessage(); + $this->icon = $this->internalStatus->getCustomIcon(); + + if ($this->internalStatus->getStatus() === IUserStatus::INVISIBLE) { $this->status = IUserStatus::OFFLINE; } - if ($status->getClearAt() !== null) { - $this->clearAt = DateTimeImmutable::createFromFormat('U', (string)$status->getClearAt()); + if ($this->internalStatus->getClearAt() !== null) { + $this->clearAt = DateTimeImmutable::createFromFormat('U', (string)$this->internalStatus->getClearAt()); } } diff --git a/apps/user_status/lib/Connector/UserStatusProvider.php b/apps/user_status/lib/Connector/UserStatusProvider.php index a85223dcf2a..e84d69d1eb2 100644 --- a/apps/user_status/lib/Connector/UserStatusProvider.php +++ b/apps/user_status/lib/Connector/UserStatusProvider.php @@ -14,16 +14,14 @@ use OCP\UserStatus\IProvider; class UserStatusProvider implements IProvider, ISettableProvider { - /** @var StatusService */ - private $service; - /** * UserStatusProvider constructor. * * @param StatusService $service */ - public function __construct(StatusService $service) { - $this->service = $service; + public function __construct( + private StatusService $service, + ) { } /** |