@@ -71,7 +71,7 @@ |
||
71 | 71 | */ |
72 | 72 | protected function execute(InputInterface $input, OutputInterface $output) { |
73 | 73 | $mode = $this->getMode(); |
74 | - $this->config->setAppValue( 'core', 'backgroundjobs_mode', $mode ); |
|
74 | + $this->config->setAppValue('core', 'backgroundjobs_mode', $mode); |
|
75 | 75 | $output->writeln("Set mode for background jobs to '$mode'"); |
76 | 76 | } |
77 | 77 | } |
@@ -72,19 +72,19 @@ |
||
72 | 72 | default: |
73 | 73 | foreach ($items as $key => $item) { |
74 | 74 | if (is_array($item)) { |
75 | - $output->writeln($prefix . $key . ':'); |
|
76 | - $this->writeArrayInOutputFormat($input, $output, $item, ' ' . $prefix); |
|
75 | + $output->writeln($prefix.$key.':'); |
|
76 | + $this->writeArrayInOutputFormat($input, $output, $item, ' '.$prefix); |
|
77 | 77 | continue; |
78 | 78 | } |
79 | 79 | if (!is_int($key)) { |
80 | 80 | $value = $this->valueToString($item); |
81 | 81 | if (!is_null($value)) { |
82 | - $output->writeln($prefix . $key . ': ' . $value); |
|
82 | + $output->writeln($prefix.$key.': '.$value); |
|
83 | 83 | } else { |
84 | - $output->writeln($prefix . $key); |
|
84 | + $output->writeln($prefix.$key); |
|
85 | 85 | } |
86 | 86 | } else { |
87 | - $output->writeln($prefix . $this->valueToString($item)); |
|
87 | + $output->writeln($prefix.$this->valueToString($item)); |
|
88 | 88 | } |
89 | 89 | } |
90 | 90 | break; |
@@ -66,7 +66,7 @@ discard block |
||
66 | 66 | |
67 | 67 | if (sizeof($configNames) > 1) { |
68 | 68 | if ($input->hasParameterOption('--error-if-not-exists') && !in_array($configName, $this->systemConfig->getKeys())) { |
69 | - $output->writeln('<error>System config ' . implode(' => ', $configNames) . ' could not be deleted because it did not exist</error>'); |
|
69 | + $output->writeln('<error>System config '.implode(' => ', $configNames).' could not be deleted because it did not exist</error>'); |
|
70 | 70 | return 1; |
71 | 71 | } |
72 | 72 | |
@@ -76,21 +76,21 @@ discard block |
||
76 | 76 | $value = $this->removeSubValue(array_slice($configNames, 1), $value, $input->hasParameterOption('--error-if-not-exists')); |
77 | 77 | } |
78 | 78 | catch (\UnexpectedValueException $e) { |
79 | - $output->writeln('<error>System config ' . implode(' => ', $configNames) . ' could not be deleted because it did not exist</error>'); |
|
79 | + $output->writeln('<error>System config '.implode(' => ', $configNames).' could not be deleted because it did not exist</error>'); |
|
80 | 80 | return 1; |
81 | 81 | } |
82 | 82 | |
83 | 83 | $this->systemConfig->setValue($configName, $value); |
84 | - $output->writeln('<info>System config value ' . implode(' => ', $configNames) . ' deleted</info>'); |
|
84 | + $output->writeln('<info>System config value '.implode(' => ', $configNames).' deleted</info>'); |
|
85 | 85 | return 0; |
86 | 86 | } else { |
87 | 87 | if ($input->hasParameterOption('--error-if-not-exists') && !in_array($configName, $this->systemConfig->getKeys())) { |
88 | - $output->writeln('<error>System config ' . $configName . ' could not be deleted because it did not exist</error>'); |
|
88 | + $output->writeln('<error>System config '.$configName.' could not be deleted because it did not exist</error>'); |
|
89 | 89 | return 1; |
90 | 90 | } |
91 | 91 | |
92 | 92 | $this->systemConfig->deleteValue($configName); |
93 | - $output->writeln('<info>System config value ' . $configName . ' deleted</info>'); |
|
93 | + $output->writeln('<info>System config value '.$configName.' deleted</info>'); |
|
94 | 94 | return 0; |
95 | 95 | } |
96 | 96 | } |
@@ -97,7 +97,7 @@ discard block |
||
97 | 97 | $this->systemConfig->setValue($configName, $configValue['value']); |
98 | 98 | } |
99 | 99 | |
100 | - $output->writeln('<info>System config value ' . implode(' => ', $configNames) . ' set to ' . $configValue['readable-value'] . '</info>'); |
|
100 | + $output->writeln('<info>System config value '.implode(' => ', $configNames).' set to '.$configValue['readable-value'].'</info>'); |
|
101 | 101 | return 0; |
102 | 102 | } |
103 | 103 | |
@@ -116,7 +116,7 @@ discard block |
||
116 | 116 | } |
117 | 117 | return [ |
118 | 118 | 'value' => (int) $value, |
119 | - 'readable-value' => 'integer ' . (int) $value, |
|
119 | + 'readable-value' => 'integer '.(int) $value, |
|
120 | 120 | ]; |
121 | 121 | |
122 | 122 | case 'double': |
@@ -126,7 +126,7 @@ discard block |
||
126 | 126 | } |
127 | 127 | return [ |
128 | 128 | 'value' => (double) $value, |
129 | - 'readable-value' => 'double ' . (double) $value, |
|
129 | + 'readable-value' => 'double '.(double) $value, |
|
130 | 130 | ]; |
131 | 131 | |
132 | 132 | case 'boolean': |
@@ -136,13 +136,13 @@ discard block |
||
136 | 136 | case 'true': |
137 | 137 | return [ |
138 | 138 | 'value' => true, |
139 | - 'readable-value' => 'boolean ' . $value, |
|
139 | + 'readable-value' => 'boolean '.$value, |
|
140 | 140 | ]; |
141 | 141 | |
142 | 142 | case 'false': |
143 | 143 | return [ |
144 | 144 | 'value' => false, |
145 | - 'readable-value' => 'boolean ' . $value, |
|
145 | + 'readable-value' => 'boolean '.$value, |
|
146 | 146 | ]; |
147 | 147 | |
148 | 148 | default: |
@@ -159,7 +159,7 @@ discard block |
||
159 | 159 | $value = (string) $value; |
160 | 160 | return [ |
161 | 161 | 'value' => $value, |
162 | - 'readable-value' => ($value === '') ? 'empty string' : 'string ' . $value, |
|
162 | + 'readable-value' => ($value === '') ? 'empty string' : 'string '.$value, |
|
163 | 163 | ]; |
164 | 164 | |
165 | 165 | default: |
@@ -70,12 +70,12 @@ |
||
70 | 70 | $configName = $input->getArgument('name'); |
71 | 71 | |
72 | 72 | if ($input->hasParameterOption('--error-if-not-exists') && !in_array($configName, $this->config->getAppKeys($appName))) { |
73 | - $output->writeln('<error>Config ' . $configName . ' of app ' . $appName . ' could not be deleted because it did not exist</error>'); |
|
73 | + $output->writeln('<error>Config '.$configName.' of app '.$appName.' could not be deleted because it did not exist</error>'); |
|
74 | 74 | return 1; |
75 | 75 | } |
76 | 76 | |
77 | 77 | $this->config->deleteAppValue($appName, $configName); |
78 | - $output->writeln('<info>Config value ' . $configName . ' of app ' . $appName . ' deleted</info>'); |
|
78 | + $output->writeln('<info>Config value '.$configName.' of app '.$appName.' deleted</info>'); |
|
79 | 79 | return 0; |
80 | 80 | } |
81 | 81 | } |
@@ -76,14 +76,14 @@ |
||
76 | 76 | $configName = $input->getArgument('name'); |
77 | 77 | |
78 | 78 | if (!in_array($configName, $this->config->getAppKeys($appName)) && $input->hasParameterOption('--update-only')) { |
79 | - $output->writeln('<comment>Config value ' . $configName . ' for app ' . $appName . ' not updated, as it has not been set before.</comment>'); |
|
79 | + $output->writeln('<comment>Config value '.$configName.' for app '.$appName.' not updated, as it has not been set before.</comment>'); |
|
80 | 80 | return 1; |
81 | 81 | } |
82 | 82 | |
83 | 83 | $configValue = $input->getOption('value'); |
84 | 84 | $this->config->setAppValue($appName, $configName, $configValue); |
85 | 85 | |
86 | - $output->writeln('<info>Config value ' . $configName . ' for app ' . $appName . ' set to ' . $configValue . '</info>'); |
|
86 | + $output->writeln('<info>Config value '.$configName.' for app '.$appName.' set to '.$configValue.'</info>'); |
|
87 | 87 | return 0; |
88 | 88 | } |
89 | 89 | } |
@@ -32,7 +32,7 @@ discard block |
||
32 | 32 | use Symfony\Component\Console\Input\InputInterface; |
33 | 33 | use Symfony\Component\Console\Output\OutputInterface; |
34 | 34 | |
35 | -class Import extends Command implements CompletionAwareInterface { |
|
35 | +class Import extends Command implements CompletionAwareInterface { |
|
36 | 36 | protected $validRootKeys = ['system', 'apps']; |
37 | 37 | |
38 | 38 | /** @var IConfig */ |
@@ -69,7 +69,7 @@ discard block |
||
69 | 69 | try { |
70 | 70 | $configs = $this->validateFileContent($content); |
71 | 71 | } catch (\UnexpectedValueException $e) { |
72 | - $output->writeln('<error>' . $e->getMessage(). '</error>'); |
|
72 | + $output->writeln('<error>'.$e->getMessage().'</error>'); |
|
73 | 73 | return; |
74 | 74 | } |
75 | 75 | |
@@ -89,7 +89,7 @@ discard block |
||
89 | 89 | } |
90 | 90 | } |
91 | 91 | |
92 | - $output->writeln('<info>Config successfully imported from: ' . $importFile . '</info>'); |
|
92 | + $output->writeln('<info>Config successfully imported from: '.$importFile.'</info>'); |
|
93 | 93 | } |
94 | 94 | |
95 | 95 | /** |
@@ -143,10 +143,10 @@ discard block |
||
143 | 143 | $additionalKeys = array_diff($arrayKeys, $this->validRootKeys); |
144 | 144 | $commonKeys = array_intersect($arrayKeys, $this->validRootKeys); |
145 | 145 | if (!empty($additionalKeys)) { |
146 | - throw new \UnexpectedValueException('Found invalid entries in root: ' . implode(', ', $additionalKeys)); |
|
146 | + throw new \UnexpectedValueException('Found invalid entries in root: '.implode(', ', $additionalKeys)); |
|
147 | 147 | } |
148 | 148 | if (empty($commonKeys)) { |
149 | - throw new \UnexpectedValueException('At least one key of the following is expected: ' . implode(', ', $this->validRootKeys)); |
|
149 | + throw new \UnexpectedValueException('At least one key of the following is expected: '.implode(', ', $this->validRootKeys)); |
|
150 | 150 | } |
151 | 151 | |
152 | 152 | if (isset($array['system'])) { |
@@ -174,7 +174,7 @@ discard block |
||
174 | 174 | */ |
175 | 175 | protected function checkTypeRecursively($configValue, $configName) { |
176 | 176 | if (!is_array($configValue) && !is_bool($configValue) && !is_int($configValue) && !is_string($configValue) && !is_null($configValue)) { |
177 | - throw new \UnexpectedValueException('Invalid system config value for "' . $configName . '". Only arrays, bools, integers, strings and null (delete) are allowed.'); |
|
177 | + throw new \UnexpectedValueException('Invalid system config value for "'.$configName.'". Only arrays, bools, integers, strings and null (delete) are allowed.'); |
|
178 | 178 | } |
179 | 179 | if (is_array($configValue)) { |
180 | 180 | foreach ($configValue as $key => $value) { |
@@ -192,7 +192,7 @@ discard block |
||
192 | 192 | foreach ($array as $app => $configs) { |
193 | 193 | foreach ($configs as $name => $value) { |
194 | 194 | if (!is_int($value) && !is_string($value) && !is_null($value)) { |
195 | - throw new \UnexpectedValueException('Invalid app config value for "' . $app . '":"' . $name . '". Only integers, strings and null (delete) are allowed.'); |
|
195 | + throw new \UnexpectedValueException('Invalid app config value for "'.$app.'":"'.$name.'". Only integers, strings and null (delete) are allowed.'); |
|
196 | 196 | } |
197 | 197 | } |
198 | 198 | } |
@@ -62,10 +62,10 @@ discard block |
||
62 | 62 | } |
63 | 63 | $languages = $lang; |
64 | 64 | if (empty($lang)) { |
65 | - $languages= $this->getAllLanguages($path); |
|
65 | + $languages = $this->getAllLanguages($path); |
|
66 | 66 | } |
67 | 67 | |
68 | - foreach($languages as $lang) { |
|
68 | + foreach ($languages as $lang) { |
|
69 | 69 | $this->writeFiles($app, $path, $lang, $output); |
70 | 70 | } |
71 | 71 | } |
@@ -73,16 +73,16 @@ discard block |
||
73 | 73 | private function getAllLanguages($path) { |
74 | 74 | $result = array(); |
75 | 75 | foreach (new DirectoryIterator("$path/l10n") as $fileInfo) { |
76 | - if($fileInfo->isDot()) { |
|
76 | + if ($fileInfo->isDot()) { |
|
77 | 77 | continue; |
78 | 78 | } |
79 | - if($fileInfo->isDir()) { |
|
79 | + if ($fileInfo->isDir()) { |
|
80 | 80 | continue; |
81 | 81 | } |
82 | - if($fileInfo->getExtension() !== 'php') { |
|
82 | + if ($fileInfo->getExtension() !== 'php') { |
|
83 | 83 | continue; |
84 | 84 | } |
85 | - $result[]= substr($fileInfo->getBasename(), 0, -4); |
|
85 | + $result[] = substr($fileInfo->getBasename(), 0, -4); |
|
86 | 86 | } |
87 | 87 | |
88 | 88 | return $result; |
@@ -104,7 +104,7 @@ discard block |
||
104 | 104 | $jsTrans = array(); |
105 | 105 | foreach ($translations as $id => $val) { |
106 | 106 | if (is_array($val)) { |
107 | - $val = '[ ' . join(',', $val) . ']'; |
|
107 | + $val = '[ '.join(',', $val).']'; |
|
108 | 108 | } |
109 | 109 | $jsTrans[] = "\"$id\" : \"$val\""; |
110 | 110 | } |
@@ -78,8 +78,8 @@ discard block |
||
78 | 78 | $this->printErrors($output, $errors); |
79 | 79 | |
80 | 80 | // ignore the OS X setup warning |
81 | - if(count($errors) !== 1 || |
|
82 | - (string)($errors[0]['error']) !== 'Mac OS X is not supported and Nextcloud will not work properly on this platform. Use it at your own risk! ') { |
|
81 | + if (count($errors) !== 1 || |
|
82 | + (string) ($errors[0]['error']) !== 'Mac OS X is not supported and Nextcloud will not work properly on this platform. Use it at your own risk! ') { |
|
83 | 83 | return 1; |
84 | 84 | } |
85 | 85 | } |
@@ -180,10 +180,10 @@ discard block |
||
180 | 180 | protected function printErrors(OutputInterface $output, $errors) { |
181 | 181 | foreach ($errors as $error) { |
182 | 182 | if (is_array($error)) { |
183 | - $output->writeln('<error>' . (string)$error['error'] . '</error>'); |
|
184 | - $output->writeln('<info> -> ' . (string)$error['hint'] . '</info>'); |
|
183 | + $output->writeln('<error>'.(string) $error['error'].'</error>'); |
|
184 | + $output->writeln('<info> -> '.(string) $error['hint'].'</info>'); |
|
185 | 185 | } else { |
186 | - $output->writeln('<error>' . (string)$error . '</error>'); |
|
186 | + $output->writeln('<error>'.(string) $error.'</error>'); |
|
187 | 187 | } |
188 | 188 | } |
189 | 189 | } |