aboutsummaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorMarcel Klehr <mklehr@gmx.net>2024-01-10 16:15:06 +0100
committerMarcel Klehr <mklehr@gmx.net>2024-01-10 16:15:06 +0100
commit970eb692d19a15e4f2874d932091119245f32aef (patch)
tree1ae9d5da7136390ea980f37c6675cf4636760711 /lib
parent1db8888f999e97427959f64ae846a05ccbb3d6c4 (diff)
downloadnextcloud-server-970eb692d19a15e4f2874d932091119245f32aef.tar.gz
nextcloud-server-970eb692d19a15e4f2874d932091119245f32aef.zip
fix(coding style)
Signed-off-by: Marcel Klehr <mklehr@gmx.net>
Diffstat (limited to 'lib')
-rw-r--r--lib/private/Translation/TranslationManager.php14
1 files changed, 7 insertions, 7 deletions
diff --git a/lib/private/Translation/TranslationManager.php b/lib/private/Translation/TranslationManager.php
index 4b5facebac6..306275121ea 100644
--- a/lib/private/Translation/TranslationManager.php
+++ b/lib/private/Translation/TranslationManager.php
@@ -77,17 +77,17 @@ class TranslationManager implements ITranslationManager {
$precedence = json_decode($json, true);
$newProviders = [];
foreach ($precedence as $className) {
- $provider = current(array_filter($providers, fn ($provider) =>
- $provider instanceof ITranslationProviderWithId ? $provider->getId() === $className : $provider::class === $className))
- ;
+ $provider = current(array_filter($providers, function ($provider) use ($className) {
+ return $provider instanceof ITranslationProviderWithId ? $provider->getId() === $className : $provider::class === $className;
+ }));
if ($provider !== false) {
$newProviders[] = $provider;
}
}
// Add all providers that haven't been added so far
- $newProviders += array_udiff($providers, $newProviders, fn ($a, $b) =>
- ($a instanceof ITranslationProviderWithId ? $a->getId() : $a::class) <=> ($b instanceof ITranslationProviderWithId ? $b->getId() : $b::class)
- );
+ $newProviders += array_udiff($providers, $newProviders, function ($a, $b) {
+ return ($a instanceof ITranslationProviderWithId ? $a->getId() : $a::class) <=> ($b instanceof ITranslationProviderWithId ? $b->getId() : $b::class);
+ });
$providers = $newProviders;
}
@@ -116,7 +116,7 @@ class TranslationManager implements ITranslationManager {
foreach ($providers as $provider) {
try {
- if ($provider instanceof ITranslationProviderWithUserId) {
+ if ($provider instanceof ITranslationProviderWithUserId) {
$provider->setUserId($this->userSession->getUser()?->getUID());
}
return $provider->translate($fromLanguage, $toLanguage, $text);