-
-
Notifications
You must be signed in to change notification settings - Fork 4.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add typings to config #35581
Add typings to config #35581
Conversation
@@ -34,12 +34,12 @@ | |||
$shareManager = Server::get(IManager::class); | |||
$publicUploadEnabled = $shareManager->shareApiLinkAllowPublicUpload() ? 'yes' : 'no'; | |||
|
|||
$showgridview = $config->getUserValue($userSession->getUser()->getUID(), 'files', 'show_grid', false); | |||
$showgridview = $config->getUserValue($userSession->getUser()->getUID(), 'files', 'show_grid', 'false'); |
Check notice
Code scanning / Psalm
PossiblyNullReference
@@ -27,11 +27,11 @@ | |||
$config = \OC::$server->getConfig(); | |||
$userSession = \OC::$server->getUserSession(); | |||
|
|||
$showgridview = $config->getUserValue($userSession->getUser()->getUID(), 'files', 'show_grid', false); | |||
$showgridview = $config->getUserValue($userSession->getUser()->getUID(), 'files', 'show_grid', 'false'); |
Check notice
Code scanning / Psalm
PossiblyNullReference
@@ -25,11 +25,11 @@ | |||
$config = \OC::$server->getConfig(); | |||
$userSession = \OC::$server->getUserSession(); | |||
|
|||
$showgridview = $config->getUserValue($userSession->getUser()->getUID(), 'files', 'show_grid', false); | |||
$showgridview = $config->getUserValue($userSession->getUser()->getUID(), 'files', 'show_grid', 'false'); |
Check notice
Code scanning / Psalm
PossiblyNullReference
@@ -30,11 +30,11 @@ | |||
$config = Server::get(IConfig::class); | |||
$userSession = Server::get(IUserSession::class); | |||
|
|||
$showgridview = $config->getUserValue($userSession->getUser()->getUID(), 'files', 'show_grid', false); | |||
$showgridview = $config->getUserValue($userSession->getUser()->getUID(), 'files', 'show_grid', 'false'); |
Check notice
Code scanning / Psalm
PossiblyNullReference
@@ -28,11 +28,11 @@ | |||
$config = \OC::$server->getConfig(); | |||
$userSession = \OC::$server->getUserSession(); | |||
|
|||
$showgridview = $config->getUserValue($userSession->getUser()->getUID(), 'files', 'show_grid', false); | |||
$showgridview = $config->getUserValue($userSession->getUser()->getUID(), 'files', 'show_grid', 'false'); |
Check notice
Code scanning / Psalm
PossiblyNullReference
Signed-off-by: J0WI <J0WI@users.noreply.github.com>
I would vote for adding String/Bool/Int variant to getUserValue and getAppValue as well. |
agreed, but it's way too much work to solve this at once. |
Hello @J0WI, it seems this PR has not had much activity for a while now. Please let us know if you'd like us to reopen this! |
Summary
Add some typing interfaces to config classes.
TODO (not in this PR)
''
vsnull
usage in default vaules.getSystemValue
with type save alternativesgetUserValue
andgetAppValue
Checklist