summaryrefslogtreecommitdiffstats
path: root/lib/private/L10N/Factory.php
diff options
context:
space:
mode:
authorChristoph Wurst <christoph@winzerhof-wurst.at>2020-04-10 14:19:56 +0200
committerChristoph Wurst <christoph@winzerhof-wurst.at>2020-04-10 14:19:56 +0200
commitcaff1023ea72bb2ea94130e18a2a6e2ccf819e5f (patch)
tree186d494c2aea5dea7255d3584ef5d595fc6e6194 /lib/private/L10N/Factory.php
parentedf8ce32cffdb920e8171207b342abbd7f1fbe73 (diff)
downloadnextcloud-server-caff1023ea72bb2ea94130e18a2a6e2ccf819e5f.tar.gz
nextcloud-server-caff1023ea72bb2ea94130e18a2a6e2ccf819e5f.zip
Format control structures, classes, methods and function
To continue this formatting madness, here's a tiny patch that adds unified formatting for control structures like if and loops as well as classes, their methods and anonymous functions. This basically forces the constructs to start on the same line. This is not exactly what PSR2 wants, but I think we can have a few exceptions with "our" style. The starting of braces on the same line is pracrically standard for our code. This also removes and empty lines from method/function bodies at the beginning and end. Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
Diffstat (limited to 'lib/private/L10N/Factory.php')
-rw-r--r--lib/private/L10N/Factory.php7
1 files changed, 3 insertions, 4 deletions
diff --git a/lib/private/L10N/Factory.php b/lib/private/L10N/Factory.php
index a5b208cfb3c..a1afb1f4f0a 100644
--- a/lib/private/L10N/Factory.php
+++ b/lib/private/L10N/Factory.php
@@ -115,7 +115,6 @@ class Factory implements IFactory {
*/
public function get($app, $lang = null, $locale = null) {
return new LazyL10N(function () use ($app, $lang, $locale) {
-
$app = \OC_App::cleanAppId($app);
if ($lang !== null) {
$lang = str_replace(['\0', '/', '\\', '..'], '', (string)$lang);
@@ -353,7 +352,7 @@ class Factory implements IFactory {
public function getLanguageIterator(IUser $user = null): ILanguageIterator {
$user = $user ?? $this->userSession->getUser();
- if($user === null) {
+ if ($user === null) {
throw new \RuntimeException('Failed to get an IUser instance');
}
return new LanguageIterator($user, $this->config);
@@ -543,7 +542,7 @@ class Factory implements IFactory {
$res = '';
$p = 0;
$length = strlen($body);
- for($i = 0; $i < $length; $i++) {
+ for ($i = 0; $i < $length; $i++) {
$ch = $body[$i];
switch ($ch) {
case '?':
@@ -594,7 +593,7 @@ class Factory implements IFactory {
$commonLanguages = [];
$languages = [];
- foreach($languageCodes as $lang) {
+ foreach ($languageCodes as $lang) {
$l = $this->get('lib', $lang);
// TRANSLATORS this is the language name for the language switcher in the personal settings and should be the localized version
$potentialName = (string) $l->t('__language_name__');