Skip to content
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

Closed
wants to merge 1 commit into from
Closed

Add typings to config #35581

wants to merge 1 commit into from

Conversation

J0WI
Copy link
Contributor

@J0WI J0WI commented Dec 3, 2022

Summary

Add some typing interfaces to config classes.

TODO (not in this PR)

  • get rid of the mixed '' vs null usage in default vaules.
  • replace getSystemValue with type save alternatives
  • maybe also implement type safe getUserValue and getAppValue

Checklist

apps/user_ldap/lib/User/User.php Fixed Show fixed Hide fixed
apps/user_ldap/lib/User/User.php Fixed Show fixed Hide fixed
@@ -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

Cannot call method getUID on possibly null value
@@ -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

Cannot call method getUID on possibly null value
@@ -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

Cannot call method getUID on possibly null value
@@ -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

Cannot call method getUID on possibly null value
@@ -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

Cannot call method getUID on possibly null value
@J0WI J0WI added the 2. developing Work in progress label Dec 3, 2022
@szaimen szaimen added this to the Nextcloud 26 milestone Dec 4, 2022
Signed-off-by: J0WI <J0WI@users.noreply.github.com>
@come-nc
Copy link
Contributor

come-nc commented Dec 6, 2022

I would vote for adding String/Bool/Int variant to getUserValue and getAppValue as well.

@J0WI
Copy link
Contributor Author

J0WI commented Dec 6, 2022

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.

@blizzz blizzz mentioned this pull request Feb 1, 2023
@skjnldsv skjnldsv mentioned this pull request Feb 23, 2023
@blizzz blizzz mentioned this pull request Mar 7, 2023
@blizzz blizzz modified the milestones: Nextcloud 26, Nextcloud 27 Mar 9, 2023
This was referenced May 3, 2023
@skjnldsv skjnldsv modified the milestones: Nextcloud 27, Nextcloud 28 May 9, 2023
@skjnldsv skjnldsv mentioned this pull request Nov 1, 2023
This was referenced Nov 6, 2023
This was referenced Nov 14, 2023
@blizzz blizzz modified the milestones: Nextcloud 28, Nextcloud 29 Nov 23, 2023
@Altahrim Altahrim mentioned this pull request Mar 12, 2024
This was referenced Mar 14, 2024
@skjnldsv skjnldsv modified the milestones: Nextcloud 29, Nextcloud 30 Mar 28, 2024
@skjnldsv skjnldsv modified the milestones: Nextcloud 30, Nextcloud 31 Aug 14, 2024
@skjnldsv skjnldsv closed this Aug 14, 2024
@skjnldsv skjnldsv removed this from the Nextcloud 31 milestone Aug 14, 2024
@sorbaugh
Copy link
Contributor

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!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
2. developing Work in progress
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants