aboutsummaryrefslogtreecommitdiffstats
path: root/apps/files/lib/Service
diff options
context:
space:
mode:
authorJohn Molakvoæ <skjnldsv@protonmail.com>2022-12-28 15:29:54 +0100
committerJohn Molakvoæ <skjnldsv@protonmail.com>2023-01-04 16:46:14 +0100
commit5b9a8f0407a9e3fe7e00f0fc9284ea986905f1b5 (patch)
tree1363678dab6ed5e1554a7a74bc8a6a1a55bdf785 /apps/files/lib/Service
parent8f1bf13ae3046400ce6248fb13e5515e8e9ed5c4 (diff)
downloadnextcloud-server-5b9a8f0407a9e3fe7e00f0fc9284ea986905f1b5.tar.gz
nextcloud-server-5b9a8f0407a9e3fe7e00f0fc9284ea986905f1b5.zip
Add component testing
Signed-off-by: John Molakvoæ <skjnldsv@protonmail.com>
Diffstat (limited to 'apps/files/lib/Service')
-rw-r--r--apps/files/lib/Service/UserConfig.php9
1 files changed, 5 insertions, 4 deletions
diff --git a/apps/files/lib/Service/UserConfig.php b/apps/files/lib/Service/UserConfig.php
index e3b863c7333..7ccf7008512 100644
--- a/apps/files/lib/Service/UserConfig.php
+++ b/apps/files/lib/Service/UserConfig.php
@@ -41,8 +41,9 @@ class UserConfig {
],
];
- private IConfig $config;
- private IUser|null $user;
+ protected IConfig $config;
+ /** @var \OCP\IUser|null */
+ protected mixed $user = null;
public function __construct(IConfig $config, IUserSession $userSession) {
$this->config = $config;
@@ -98,7 +99,7 @@ class UserConfig {
* @throws \InvalidArgumentException
*/
public function setConfig($key, $value) {
- if (!$this->user) {
+ if ($this->user === null) {
throw new \Exception('No user logged in');
}
@@ -123,7 +124,7 @@ class UserConfig {
* @return array
*/
public function getConfigs(): array {
- if (!$this->user) {
+ if ($this->user === null) {
throw new \Exception('No user logged in');
}