@@ -34,7 +34,7 @@ discard block |
||
34 | 34 | * @return bool |
35 | 35 | */ |
36 | 36 | private function isValidVersionString($versionString) { |
37 | - return (bool)preg_match('/^[0-9.]+$/', $versionString); |
|
37 | + return (bool) preg_match('/^[0-9.]+$/', $versionString); |
|
38 | 38 | } |
39 | 39 | |
40 | 40 | /** |
@@ -46,7 +46,7 @@ discard block |
||
46 | 46 | */ |
47 | 47 | public function getVersion($versionSpec) { |
48 | 48 | // * indicates that the version is compatible with all versions |
49 | - if($versionSpec === '*') { |
|
49 | + if ($versionSpec === '*') { |
|
50 | 50 | return new Version('', ''); |
51 | 51 | } |
52 | 52 | |
@@ -58,17 +58,17 @@ discard block |
||
58 | 58 | $secondVersion = isset($versionElements[1]) ? $versionElements[1] : ''; |
59 | 59 | $secondVersionNumber = substr($secondVersion, 2); |
60 | 60 | |
61 | - switch(count($versionElements)) { |
|
61 | + switch (count($versionElements)) { |
|
62 | 62 | case 1: |
63 | - if(!$this->isValidVersionString($firstVersionNumber)) { |
|
63 | + if (!$this->isValidVersionString($firstVersionNumber)) { |
|
64 | 64 | break; |
65 | 65 | } |
66 | - if(strpos($firstVersion, '>') === 0) { |
|
66 | + if (strpos($firstVersion, '>') === 0) { |
|
67 | 67 | return new Version($firstVersionNumber, ''); |
68 | 68 | } |
69 | 69 | return new Version('', $firstVersionNumber); |
70 | 70 | case 2: |
71 | - if(!$this->isValidVersionString($firstVersionNumber) || !$this->isValidVersionString($secondVersionNumber)) { |
|
71 | + if (!$this->isValidVersionString($firstVersionNumber) || !$this->isValidVersionString($secondVersionNumber)) { |
|
72 | 72 | break; |
73 | 73 | } |
74 | 74 | return new Version($firstVersionNumber, $secondVersionNumber); |
@@ -78,7 +78,7 @@ discard block |
||
78 | 78 | |
79 | 79 | $server->on('report', [$this, 'report']); |
80 | 80 | |
81 | - $server->xml->elementMap['{' . self::NS_Nextcloud . '}calendar-search'] = |
|
81 | + $server->xml->elementMap['{'.self::NS_Nextcloud.'}calendar-search'] = |
|
82 | 82 | CalendarSearchReport::class; |
83 | 83 | } |
84 | 84 | |
@@ -92,7 +92,7 @@ discard block |
||
92 | 92 | */ |
93 | 93 | public function report($reportName, $report, $path) { |
94 | 94 | switch ($reportName) { |
95 | - case '{' . self::NS_Nextcloud . '}calendar-search': |
|
95 | + case '{'.self::NS_Nextcloud.'}calendar-search': |
|
96 | 96 | $this->server->transactionType = 'report-nc-calendar-search'; |
97 | 97 | $this->calendarSearch($report); |
98 | 98 | return false; |
@@ -114,7 +114,7 @@ discard block |
||
114 | 114 | |
115 | 115 | $reports = []; |
116 | 116 | if ($node instanceof CalendarHome) { |
117 | - $reports[] = '{' . self::NS_Nextcloud . '}calendar-search'; |
|
117 | + $reports[] = '{'.self::NS_Nextcloud.'}calendar-search'; |
|
118 | 118 | } |
119 | 119 | |
120 | 120 | return $reports; |
@@ -144,7 +144,7 @@ discard block |
||
144 | 144 | |
145 | 145 | foreach ($nodePaths as $path) { |
146 | 146 | list($properties) = $this->server->getPropertiesForPath( |
147 | - $this->server->getRequestUri() . '/' . $path, |
|
147 | + $this->server->getRequestUri().'/'.$path, |
|
148 | 148 | $report->properties); |
149 | 149 | $result[] = $properties; |
150 | 150 | } |
@@ -51,8 +51,8 @@ discard block |
||
51 | 51 | } |
52 | 52 | |
53 | 53 | public function get($key) { |
54 | - $result = self::$cache->get($this->getNameSpace() . $key); |
|
55 | - if ($result === false && !self::$cache->exists($this->getNameSpace() . $key)) { |
|
54 | + $result = self::$cache->get($this->getNameSpace().$key); |
|
55 | + if ($result === false && !self::$cache->exists($this->getNameSpace().$key)) { |
|
56 | 56 | return null; |
57 | 57 | } else { |
58 | 58 | return json_decode($result, true); |
@@ -61,18 +61,18 @@ discard block |
||
61 | 61 | |
62 | 62 | public function set($key, $value, $ttl = 0) { |
63 | 63 | if ($ttl > 0) { |
64 | - return self::$cache->setex($this->getNameSpace() . $key, $ttl, json_encode($value)); |
|
64 | + return self::$cache->setex($this->getNameSpace().$key, $ttl, json_encode($value)); |
|
65 | 65 | } else { |
66 | - return self::$cache->set($this->getNameSpace() . $key, json_encode($value)); |
|
66 | + return self::$cache->set($this->getNameSpace().$key, json_encode($value)); |
|
67 | 67 | } |
68 | 68 | } |
69 | 69 | |
70 | 70 | public function hasKey($key) { |
71 | - return self::$cache->exists($this->getNameSpace() . $key); |
|
71 | + return self::$cache->exists($this->getNameSpace().$key); |
|
72 | 72 | } |
73 | 73 | |
74 | 74 | public function remove($key) { |
75 | - if (self::$cache->del($this->getNameSpace() . $key)) { |
|
75 | + if (self::$cache->del($this->getNameSpace().$key)) { |
|
76 | 76 | return true; |
77 | 77 | } else { |
78 | 78 | return false; |
@@ -80,7 +80,7 @@ discard block |
||
80 | 80 | } |
81 | 81 | |
82 | 82 | public function clear($prefix = '') { |
83 | - $prefix = $this->getNameSpace() . $prefix . '*'; |
|
83 | + $prefix = $this->getNameSpace().$prefix.'*'; |
|
84 | 84 | $keys = self::$cache->keys($prefix); |
85 | 85 | $deleted = self::$cache->del($keys); |
86 | 86 | |
@@ -100,7 +100,7 @@ discard block |
||
100 | 100 | if (!is_int($value)) { |
101 | 101 | $value = json_encode($value); |
102 | 102 | } |
103 | - return self::$cache->setnx($this->getPrefix() . $key, $value); |
|
103 | + return self::$cache->setnx($this->getPrefix().$key, $value); |
|
104 | 104 | } |
105 | 105 | |
106 | 106 | /** |
@@ -111,7 +111,7 @@ discard block |
||
111 | 111 | * @return int | bool |
112 | 112 | */ |
113 | 113 | public function inc($key, $step = 1) { |
114 | - return self::$cache->incrBy($this->getNameSpace() . $key, $step); |
|
114 | + return self::$cache->incrBy($this->getNameSpace().$key, $step); |
|
115 | 115 | } |
116 | 116 | |
117 | 117 | /** |
@@ -125,7 +125,7 @@ discard block |
||
125 | 125 | if (!$this->hasKey($key)) { |
126 | 126 | return false; |
127 | 127 | } |
128 | - return self::$cache->decrBy($this->getNameSpace() . $key, $step); |
|
128 | + return self::$cache->decrBy($this->getNameSpace().$key, $step); |
|
129 | 129 | } |
130 | 130 | |
131 | 131 | /** |
@@ -140,10 +140,10 @@ discard block |
||
140 | 140 | if (!is_int($new)) { |
141 | 141 | $new = json_encode($new); |
142 | 142 | } |
143 | - self::$cache->watch($this->getNameSpace() . $key); |
|
143 | + self::$cache->watch($this->getNameSpace().$key); |
|
144 | 144 | if ($this->get($key) === $old) { |
145 | 145 | $result = self::$cache->multi() |
146 | - ->set($this->getNameSpace() . $key, $new) |
|
146 | + ->set($this->getNameSpace().$key, $new) |
|
147 | 147 | ->exec(); |
148 | 148 | return $result !== false; |
149 | 149 | } |
@@ -159,10 +159,10 @@ discard block |
||
159 | 159 | * @return bool |
160 | 160 | */ |
161 | 161 | public function cad($key, $old) { |
162 | - self::$cache->watch($this->getNameSpace() . $key); |
|
162 | + self::$cache->watch($this->getNameSpace().$key); |
|
163 | 163 | if ($this->get($key) === $old) { |
164 | 164 | $result = self::$cache->multi() |
165 | - ->del($this->getNameSpace() . $key) |
|
165 | + ->del($this->getNameSpace().$key) |
|
166 | 166 | ->exec(); |
167 | 167 | return $result !== false; |
168 | 168 | } |
@@ -171,7 +171,7 @@ discard block |
||
171 | 171 | } |
172 | 172 | |
173 | 173 | public function setTTL($key, $ttl) { |
174 | - self::$cache->expire($this->getNameSpace() . $key, $ttl); |
|
174 | + self::$cache->expire($this->getNameSpace().$key, $ttl); |
|
175 | 175 | } |
176 | 176 | |
177 | 177 | static public function isAvailable() { |
@@ -57,7 +57,7 @@ |
||
57 | 57 | public static function extendJsConfig($settings) { |
58 | 58 | $appConfig = json_decode($settings['array']['oc_appconfig'], true); |
59 | 59 | |
60 | - $maxChunkSize = (int)\OC::$server->getConfig()->getAppValue('files', 'max_chunk_size', 10 * 1024 * 1024); |
|
60 | + $maxChunkSize = (int) \OC::$server->getConfig()->getAppValue('files', 'max_chunk_size', 10 * 1024 * 1024); |
|
61 | 61 | $appConfig['files'] = [ |
62 | 62 | 'max_chunk_size' => $maxChunkSize |
63 | 63 | ]; |
@@ -56,8 +56,8 @@ |
||
56 | 56 | */ |
57 | 57 | public function postConnect(ConnectionEventArgs $args) { |
58 | 58 | $sensitive = $this->caseSensitiveLike ? 'true' : 'false'; |
59 | - $args->getConnection()->executeUpdate('PRAGMA case_sensitive_like = ' . $sensitive); |
|
60 | - $args->getConnection()->executeUpdate('PRAGMA journal_mode = ' . $this->journalMode); |
|
59 | + $args->getConnection()->executeUpdate('PRAGMA case_sensitive_like = '.$sensitive); |
|
60 | + $args->getConnection()->executeUpdate('PRAGMA journal_mode = '.$this->journalMode); |
|
61 | 61 | /** @var \PDO $pdo */ |
62 | 62 | $pdo = $args->getConnection()->getWrappedConnection(); |
63 | 63 | $pdo->sqliteCreateFunction('md5', 'md5', 1); |
@@ -36,7 +36,7 @@ discard block |
||
36 | 36 | /** |
37 | 37 | * @since 9.1.0 |
38 | 38 | */ |
39 | - const KEY_ADMIN_SECTION = 'admin-section'; |
|
39 | + const KEY_ADMIN_SECTION = 'admin-section'; |
|
40 | 40 | |
41 | 41 | /** |
42 | 42 | * @since 13.0.0 |
@@ -46,7 +46,7 @@ discard block |
||
46 | 46 | /** |
47 | 47 | * @since 13.0.0 |
48 | 48 | */ |
49 | - const KEY_PERSONAL_SECTION = 'personal-section'; |
|
49 | + const KEY_PERSONAL_SECTION = 'personal-section'; |
|
50 | 50 | |
51 | 51 | /** |
52 | 52 | * @param string $type 'admin' or 'personal' |
@@ -164,7 +164,7 @@ |
||
164 | 164 | * @since 14.0.0 |
165 | 165 | */ |
166 | 166 | public function render(): string { |
167 | - $detailContent = ($this->detail !== '') ? ' <span class="download-size">(' . Util::sanitizeHTML($this->detail) . ')</span>' : ''; |
|
167 | + $detailContent = ($this->detail !== '') ? ' <span class="download-size">('.Util::sanitizeHTML($this->detail).')</span>' : ''; |
|
168 | 168 | return sprintf( |
169 | 169 | '<li id="%s"><a href="%s"><span class="icon %s"></span>%s %s</a></li>', |
170 | 170 | Util::sanitizeHTML($this->id), Util::sanitizeHTML($this->link), Util::sanitizeHTML($this->icon), Util::sanitizeHTML($this->label), $detailContent |
@@ -66,7 +66,7 @@ discard block |
||
66 | 66 | |
67 | 67 | if (count($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 | } |
@@ -118,7 +118,7 @@ discard block |
||
118 | 118 | ['app' => 'encryption']); |
119 | 119 | |
120 | 120 | if (openssl_error_string()) { |
121 | - $log->error('Encryption library openssl_pkey_new() fails: ' . openssl_error_string(), |
|
121 | + $log->error('Encryption library openssl_pkey_new() fails: '.openssl_error_string(), |
|
122 | 122 | ['app' => 'encryption']); |
123 | 123 | } |
124 | 124 | } elseif (openssl_pkey_export($res, |
@@ -133,10 +133,10 @@ discard block |
||
133 | 133 | 'privateKey' => $privateKey |
134 | 134 | ]; |
135 | 135 | } |
136 | - $log->error('Encryption library couldn\'t export users private key, please check your servers OpenSSL configuration.' . $this->user, |
|
136 | + $log->error('Encryption library couldn\'t export users private key, please check your servers OpenSSL configuration.'.$this->user, |
|
137 | 137 | ['app' => 'encryption']); |
138 | 138 | if (openssl_error_string()) { |
139 | - $log->error('Encryption Library:' . openssl_error_string(), |
|
139 | + $log->error('Encryption Library:'.openssl_error_string(), |
|
140 | 140 | ['app' => 'encryption']); |
141 | 141 | } |
142 | 142 | |
@@ -209,15 +209,15 @@ discard block |
||
209 | 209 | public function generateHeader($keyFormat = 'hash') { |
210 | 210 | |
211 | 211 | if (in_array($keyFormat, $this->supportedKeyFormats, true) === false) { |
212 | - throw new \InvalidArgumentException('key format "' . $keyFormat . '" is not supported'); |
|
212 | + throw new \InvalidArgumentException('key format "'.$keyFormat.'" is not supported'); |
|
213 | 213 | } |
214 | 214 | |
215 | 215 | $cipher = $this->getCipher(); |
216 | 216 | |
217 | 217 | $header = self::HEADER_START |
218 | - . ':cipher:' . $cipher |
|
219 | - . ':keyFormat:' . $keyFormat |
|
220 | - . ':' . self::HEADER_END; |
|
218 | + . ':cipher:'.$cipher |
|
219 | + . ':keyFormat:'.$keyFormat |
|
220 | + . ':'.self::HEADER_END; |
|
221 | 221 | |
222 | 222 | return $header; |
223 | 223 | } |
@@ -239,7 +239,7 @@ discard block |
||
239 | 239 | |
240 | 240 | if (!$encryptedContent) { |
241 | 241 | $error = 'Encryption (symmetric) of content failed'; |
242 | - $this->logger->error($error . openssl_error_string(), |
|
242 | + $this->logger->error($error.openssl_error_string(), |
|
243 | 243 | ['app' => 'encryption']); |
244 | 244 | throw new EncryptionFailedException($error); |
245 | 245 | } |
@@ -267,8 +267,8 @@ discard block |
||
267 | 267 | } |
268 | 268 | |
269 | 269 | // Workaround for OpenSSL 0.9.8. Fallback to an old cipher that should work. |
270 | - if(OPENSSL_VERSION_NUMBER < 0x1000101f) { |
|
271 | - if($cipher === 'AES-256-CTR' || $cipher === 'AES-128-CTR') { |
|
270 | + if (OPENSSL_VERSION_NUMBER < 0x1000101f) { |
|
271 | + if ($cipher === 'AES-256-CTR' || $cipher === 'AES-128-CTR') { |
|
272 | 272 | $cipher = self::LEGACY_CIPHER; |
273 | 273 | } |
274 | 274 | } |
@@ -284,7 +284,7 @@ discard block |
||
284 | 284 | * @throws \InvalidArgumentException |
285 | 285 | */ |
286 | 286 | protected function getKeySize($cipher) { |
287 | - if(isset($this->supportedCiphersAndKeySize[$cipher])) { |
|
287 | + if (isset($this->supportedCiphersAndKeySize[$cipher])) { |
|
288 | 288 | return $this->supportedCiphersAndKeySize[$cipher]; |
289 | 289 | } |
290 | 290 | |
@@ -311,7 +311,7 @@ discard block |
||
311 | 311 | * @return string |
312 | 312 | */ |
313 | 313 | private function concatIV($encryptedContent, $iv) { |
314 | - return $encryptedContent . '00iv00' . $iv; |
|
314 | + return $encryptedContent.'00iv00'.$iv; |
|
315 | 315 | } |
316 | 316 | |
317 | 317 | /** |
@@ -320,7 +320,7 @@ discard block |
||
320 | 320 | * @return string |
321 | 321 | */ |
322 | 322 | private function concatSig($encryptedContent, $signature) { |
323 | - return $encryptedContent . '00sig00' . $signature; |
|
323 | + return $encryptedContent.'00sig00'.$signature; |
|
324 | 324 | } |
325 | 325 | |
326 | 326 | /** |
@@ -332,7 +332,7 @@ discard block |
||
332 | 332 | * @return string |
333 | 333 | */ |
334 | 334 | private function addPadding($data) { |
335 | - return $data . 'xxx'; |
|
335 | + return $data.'xxx'; |
|
336 | 336 | } |
337 | 337 | |
338 | 338 | /** |
@@ -346,7 +346,7 @@ discard block |
||
346 | 346 | protected function generatePasswordHash($password, $cipher, $uid = '') { |
347 | 347 | $instanceId = $this->config->getSystemValue('instanceid'); |
348 | 348 | $instanceSecret = $this->config->getSystemValue('secret'); |
349 | - $salt = hash('sha256', $uid . $instanceId . $instanceSecret, true); |
|
349 | + $salt = hash('sha256', $uid.$instanceId.$instanceSecret, true); |
|
350 | 350 | $keySize = $this->getKeySize($cipher); |
351 | 351 | |
352 | 352 | $hash = hash_pbkdf2( |
@@ -492,7 +492,7 @@ discard block |
||
492 | 492 | * @return string |
493 | 493 | */ |
494 | 494 | private function createSignature($data, $passPhrase) { |
495 | - $passPhrase = hash('sha512', $passPhrase . 'a', true); |
|
495 | + $passPhrase = hash('sha512', $passPhrase.'a', true); |
|
496 | 496 | return hash_hmac('sha256', $data, $passPhrase); |
497 | 497 | } |
498 | 498 | |
@@ -583,7 +583,7 @@ discard block |
||
583 | 583 | if ($plainContent) { |
584 | 584 | return $plainContent; |
585 | 585 | } else { |
586 | - throw new DecryptionFailedException('Encryption library: Decryption (symmetric) of content failed: ' . openssl_error_string()); |
|
586 | + throw new DecryptionFailedException('Encryption library: Decryption (symmetric) of content failed: '.openssl_error_string()); |
|
587 | 587 | } |
588 | 588 | } |
589 | 589 | |
@@ -649,7 +649,7 @@ discard block |
||
649 | 649 | if (openssl_open($encKeyFile, $plainContent, $shareKey, $privateKey)) { |
650 | 650 | return $plainContent; |
651 | 651 | } else { |
652 | - throw new MultiKeyDecryptException('multikeydecrypt with share key failed:' . openssl_error_string()); |
|
652 | + throw new MultiKeyDecryptException('multikeydecrypt with share key failed:'.openssl_error_string()); |
|
653 | 653 | } |
654 | 654 | } |
655 | 655 | |
@@ -685,7 +685,7 @@ discard block |
||
685 | 685 | 'data' => $sealed |
686 | 686 | ]; |
687 | 687 | } else { |
688 | - throw new MultiKeyEncryptException('multikeyencryption failed ' . openssl_error_string()); |
|
688 | + throw new MultiKeyEncryptException('multikeyencryption failed '.openssl_error_string()); |
|
689 | 689 | } |
690 | 690 | } |
691 | 691 | } |