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

Use OCP\Util::getL10N instead of OC::$server->getL10N #40633

Merged
merged 4 commits into from
Feb 5, 2024

Conversation

come-nc
Copy link
Contributor

@come-nc come-nc commented Sep 26, 2023

Summary

OCP should not refer to private OC namespace, ever.
$server->getL10N is deprecated.
As there already was a helper in OCP\Util, I am using that instead of having to call tedious \OCP\Server::get(OCP\L10N\IFactory::class)->get('appname') each time.

TODO

  • Do the same change in core/ and lib/private

Checklist

@come-nc come-nc self-assigned this Sep 26, 2023
@come-nc come-nc added this to the Nextcloud 28 milestone Sep 26, 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
@come-nc come-nc force-pushed the fix/cleanup-ocp-baseline branch from f8e444d to 04018e0 Compare January 29, 2024 13:18
@come-nc come-nc force-pushed the fix/cleanup-ocp-baseline branch from 04018e0 to b600c70 Compare February 1, 2024 15:14
@come-nc come-nc marked this pull request as ready for review February 1, 2024 15:15
@come-nc come-nc added 3. to review Waiting for reviews and removed 2. developing Work in progress labels Feb 1, 2024
@@ -354,7 +354,7 @@
return @$this->invokeLDAPMethod('exopPasswd', $userDN, '', $password) ||
@$this->invokeLDAPMethod('modReplace', $userDN, $password);
} catch (ConstraintViolationException $e) {
throw new HintException('Password change rejected.', \OC::$server->getL10N('user_ldap')->t('Password change rejected. Hint: ') . $e->getMessage(), (int)$e->getCode());
throw new HintException('Password change rejected.', \OCP\Util::getL10N('user_ldap')->t('Password change rejected. Hint: ') . $e->getMessage(), (int)$e->getCode());

Check notice

Code scanning / Psalm

RedundantCast Note

Redundant cast to int
@come-nc come-nc requested review from a team, ArtificialOwl, icewind1991 and Altahrim and removed request for a team February 1, 2024 16:51
lib/private/Server.php Outdated Show resolved Hide resolved
@come-nc come-nc force-pushed the fix/cleanup-ocp-baseline branch from 485f0f4 to d5eef63 Compare February 5, 2024 09:18
Co-authored-by: Joas Schilling <[email protected]>
Signed-off-by: Côme Chilliet <[email protected]>
@come-nc come-nc force-pushed the fix/cleanup-ocp-baseline branch from d5eef63 to d97567a Compare February 5, 2024 10:16
@come-nc come-nc merged commit a026048 into master Feb 5, 2024
147 checks passed
@come-nc come-nc deleted the fix/cleanup-ocp-baseline branch February 5, 2024 13:25
@blizzz blizzz mentioned this pull request Mar 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants