Skip to content

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

$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
$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
$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
$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
$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