@@ -104,7 +104,7 @@ discard block |
||
104 | 104 | |
105 | 105 | $this->remove(true); |
106 | 106 | $type = $this->getAvatarImageType($img); |
107 | - $file = $this->folder->newFile('avatar.' . $type); |
|
107 | + $file = $this->folder->newFile('avatar.'.$type); |
|
108 | 108 | $file->putContent($data); |
109 | 109 | |
110 | 110 | try { |
@@ -257,9 +257,9 @@ discard block |
||
257 | 257 | } |
258 | 258 | |
259 | 259 | if ($size === -1) { |
260 | - $path = 'avatar.' . $ext; |
|
260 | + $path = 'avatar.'.$ext; |
|
261 | 261 | } else { |
262 | - $path = 'avatar.' . $size . '.' . $ext; |
|
262 | + $path = 'avatar.'.$size.'.'.$ext; |
|
263 | 263 | } |
264 | 264 | |
265 | 265 | try { |
@@ -275,7 +275,7 @@ discard block |
||
275 | 275 | } |
276 | 276 | } else { |
277 | 277 | $avatar = new OC_Image(); |
278 | - $file = $this->folder->getFile('avatar.' . $ext); |
|
278 | + $file = $this->folder->getFile('avatar.'.$ext); |
|
279 | 279 | $avatar->loadFromData($file->getContent()); |
280 | 280 | $avatar->resize($size); |
281 | 281 | $data = $avatar->data(); |
@@ -285,7 +285,7 @@ discard block |
||
285 | 285 | $file = $this->folder->newFile($path); |
286 | 286 | $file->putContent($data); |
287 | 287 | } catch (NotPermittedException $e) { |
288 | - $this->logger->error('Failed to save avatar for ' . $this->user->getUID()); |
|
288 | + $this->logger->error('Failed to save avatar for '.$this->user->getUID()); |
|
289 | 289 | throw new NotFoundException(); |
290 | 290 | } |
291 | 291 | } |
@@ -131,7 +131,7 @@ |
||
131 | 131 | if (isset($versions[0])) { |
132 | 132 | $highestVersion = $versions[0]; |
133 | 133 | foreach ($releases as $release) { |
134 | - if ((string)$release['version'] === (string)$highestVersion) { |
|
134 | + if ((string) $release['version'] === (string) $highestVersion) { |
|
135 | 135 | $response['data'][$dataKey]['releases'] = [$release]; |
136 | 136 | break; |
137 | 137 | } |
@@ -54,7 +54,7 @@ discard block |
||
54 | 54 | } |
55 | 55 | |
56 | 56 | if ($this->cache !== null) { |
57 | - $fileCacheKey = $file . filemtime($file); |
|
57 | + $fileCacheKey = $file.filemtime($file); |
|
58 | 58 | if ($cachedValue = $this->cache->get($fileCacheKey)) { |
59 | 59 | return json_decode($cachedValue, true); |
60 | 60 | } |
@@ -230,7 +230,7 @@ discard block |
||
230 | 230 | */ |
231 | 231 | public function xmlToArray($xml) { |
232 | 232 | if (!$xml->children()) { |
233 | - return (string)$xml; |
|
233 | + return (string) $xml; |
|
234 | 234 | } |
235 | 235 | |
236 | 236 | $array = []; |
@@ -247,15 +247,15 @@ discard block |
||
247 | 247 | '@attributes' => [], |
248 | 248 | ]; |
249 | 249 | if (!count($node->children())) { |
250 | - $value = (string)$node; |
|
250 | + $value = (string) $node; |
|
251 | 251 | if (!empty($value)) { |
252 | - $data['@value'] = (string)$node; |
|
252 | + $data['@value'] = (string) $node; |
|
253 | 253 | } |
254 | 254 | } else { |
255 | 255 | $data = array_merge($data, $this->xmlToArray($node)); |
256 | 256 | } |
257 | 257 | foreach ($attributes as $attr => $value) { |
258 | - $data['@attributes'][$attr] = (string)$value; |
|
258 | + $data['@attributes'][$attr] = (string) $value; |
|
259 | 259 | } |
260 | 260 | |
261 | 261 | if ($totalElement > 1) { |
@@ -140,7 +140,7 @@ discard block |
||
140 | 140 | $values[$appId] = 'yes'; |
141 | 141 | } |
142 | 142 | |
143 | - $this->installedAppsCache = array_filter($values, function ($value) { |
|
143 | + $this->installedAppsCache = array_filter($values, function($value) { |
|
144 | 144 | return $value !== 'no'; |
145 | 145 | }); |
146 | 146 | ksort($this->installedAppsCache); |
@@ -165,7 +165,7 @@ discard block |
||
165 | 165 | */ |
166 | 166 | public function getEnabledAppsForUser(IUser $user) { |
167 | 167 | $apps = $this->getInstalledAppsValues(); |
168 | - $appsForUser = array_filter($apps, function ($enabled) use ($user) { |
|
168 | + $appsForUser = array_filter($apps, function($enabled) use ($user) { |
|
169 | 169 | return $this->checkAppForUser($enabled, $user); |
170 | 170 | }); |
171 | 171 | return array_keys($appsForUser); |
@@ -177,7 +177,7 @@ discard block |
||
177 | 177 | */ |
178 | 178 | public function getEnabledAppsForGroup(IGroup $group): array { |
179 | 179 | $apps = $this->getInstalledAppsValues(); |
180 | - $appsForGroups = array_filter($apps, function ($enabled) use ($group) { |
|
180 | + $appsForGroups = array_filter($apps, function($enabled) use ($group) { |
|
181 | 181 | return $this->checkAppForGroups($enabled, $group); |
182 | 182 | }); |
183 | 183 | return array_keys($appsForGroups); |
@@ -249,7 +249,7 @@ discard block |
||
249 | 249 | |
250 | 250 | if (!is_array($groupIds)) { |
251 | 251 | $jsonError = json_last_error(); |
252 | - $this->logger->warning('AppManger::checkAppForUser - can\'t decode group IDs: ' . print_r($enabled, true) . ' - json error code: ' . $jsonError, ['app' => 'lib']); |
|
252 | + $this->logger->warning('AppManger::checkAppForUser - can\'t decode group IDs: '.print_r($enabled, true).' - json error code: '.$jsonError, ['app' => 'lib']); |
|
253 | 253 | return false; |
254 | 254 | } |
255 | 255 | |
@@ -282,7 +282,7 @@ discard block |
||
282 | 282 | |
283 | 283 | if (!is_array($groupIds)) { |
284 | 284 | $jsonError = json_last_error(); |
285 | - $this->logger->warning('AppManger::checkAppForUser - can\'t decode group IDs: ' . print_r($enabled, true) . ' - json error code: ' . $jsonError, ['app' => 'lib']); |
|
285 | + $this->logger->warning('AppManger::checkAppForUser - can\'t decode group IDs: '.print_r($enabled, true).' - json error code: '.$jsonError, ['app' => 'lib']); |
|
286 | 286 | return false; |
287 | 287 | } |
288 | 288 | |
@@ -372,7 +372,7 @@ discard block |
||
372 | 372 | $this->ignoreNextcloudRequirementForApp($appId); |
373 | 373 | } |
374 | 374 | |
375 | - $groupIds = array_map(function ($group) { |
|
375 | + $groupIds = array_map(function($group) { |
|
376 | 376 | /** @var \OCP\IGroup $group */ |
377 | 377 | return ($group instanceof IGroup) |
378 | 378 | ? $group->getGID() |
@@ -428,7 +428,7 @@ discard block |
||
428 | 428 | public function getAppPath($appId) { |
429 | 429 | $appPath = \OC_App::getAppPath($appId); |
430 | 430 | if ($appPath === false) { |
431 | - throw new AppPathNotFoundException('Could not find path for ' . $appId); |
|
431 | + throw new AppPathNotFoundException('Could not find path for '.$appId); |
|
432 | 432 | } |
433 | 433 | return $appPath; |
434 | 434 | } |
@@ -443,7 +443,7 @@ discard block |
||
443 | 443 | public function getAppWebPath(string $appId): string { |
444 | 444 | $appWebPath = \OC_App::getAppWebPath($appId); |
445 | 445 | if ($appWebPath === false) { |
446 | - throw new AppPathNotFoundException('Could not find web path for ' . $appId); |
|
446 | + throw new AppPathNotFoundException('Could not find web path for '.$appId); |
|
447 | 447 | } |
448 | 448 | return $appWebPath; |
449 | 449 | } |
@@ -504,7 +504,7 @@ discard block |
||
504 | 504 | } catch (AppPathNotFoundException $e) { |
505 | 505 | return null; |
506 | 506 | } |
507 | - $file = $appPath . '/appinfo/info.xml'; |
|
507 | + $file = $appPath.'/appinfo/info.xml'; |
|
508 | 508 | } |
509 | 509 | |
510 | 510 | $parser = new InfoParser($this->memCacheFactory->createLocal('core.appinfo')); |
@@ -572,7 +572,7 @@ discard block |
||
572 | 572 | */ |
573 | 573 | private function loadShippedJson() { |
574 | 574 | if ($this->shippedApps === null) { |
575 | - $shippedJson = \OC::$SERVERROOT . '/core/shipped.json'; |
|
575 | + $shippedJson = \OC::$SERVERROOT.'/core/shipped.json'; |
|
576 | 576 | if (!file_exists($shippedJson)) { |
577 | 577 | throw new \Exception("File not found: $shippedJson"); |
578 | 578 | } |
@@ -61,7 +61,7 @@ discard block |
||
61 | 61 | */ |
62 | 62 | private function hash(string $methodIdentifier, |
63 | 63 | string $userIdentifier): string { |
64 | - return hash('sha512', $methodIdentifier . $userIdentifier); |
|
64 | + return hash('sha512', $methodIdentifier.$userIdentifier); |
|
65 | 65 | } |
66 | 66 | |
67 | 67 | /** |
@@ -122,7 +122,7 @@ discard block |
||
122 | 122 | $existingAttempts = array_values($existingAttempts); |
123 | 123 | |
124 | 124 | // Store the new attempt |
125 | - $existingAttempts[] = (string)$currentTime; |
|
125 | + $existingAttempts[] = (string) $currentTime; |
|
126 | 126 | $this->cache->set($identifier, json_encode($existingAttempts)); |
127 | 127 | } |
128 | 128 | } |
@@ -144,7 +144,7 @@ discard block |
||
144 | 144 | */ |
145 | 145 | public function getKey(IUser $user): Key { |
146 | 146 | $uid = $user->getUID(); |
147 | - return $this->retrieveKey('user-' . $uid); |
|
147 | + return $this->retrieveKey('user-'.$uid); |
|
148 | 148 | } |
149 | 149 | |
150 | 150 | /** |
@@ -158,7 +158,7 @@ discard block |
||
158 | 158 | if ($instanceId === null) { |
159 | 159 | throw new \RuntimeException('no instance id!'); |
160 | 160 | } |
161 | - return $this->retrieveKey('system-' . $instanceId); |
|
161 | + return $this->retrieveKey('system-'.$instanceId); |
|
162 | 162 | } |
163 | 163 | |
164 | 164 | private function logOpensslError(): void { |
@@ -166,6 +166,6 @@ discard block |
||
166 | 166 | while ($error = openssl_error_string()) { |
167 | 167 | $errors[] = $error; |
168 | 168 | } |
169 | - $this->logger->critical('Something is wrong with your openssl setup: ' . implode(', ', $errors)); |
|
169 | + $this->logger->critical('Something is wrong with your openssl setup: '.implode(', ', $errors)); |
|
170 | 170 | } |
171 | 171 | } |
@@ -57,7 +57,7 @@ |
||
57 | 57 | public function getEncryptedValue(): string { |
58 | 58 | if ($this->encryptedValue === '') { |
59 | 59 | $sharedSecret = random_bytes(\strlen($this->value)); |
60 | - $this->encryptedValue = base64_encode($this->value ^ $sharedSecret) . ':' . base64_encode($sharedSecret); |
|
60 | + $this->encryptedValue = base64_encode($this->value ^ $sharedSecret).':'.base64_encode($sharedSecret); |
|
61 | 61 | } |
62 | 62 | |
63 | 63 | return $this->encryptedValue; |
@@ -74,7 +74,7 @@ |
||
74 | 74 | */ |
75 | 75 | public function mergePolicies(ContentSecurityPolicy $defaultPolicy, |
76 | 76 | EmptyContentSecurityPolicy $originalPolicy): ContentSecurityPolicy { |
77 | - foreach ((object)(array)$originalPolicy as $name => $value) { |
|
77 | + foreach ((object) (array) $originalPolicy as $name => $value) { |
|
78 | 78 | $setter = 'set'.ucfirst($name); |
79 | 79 | if (\is_array($value)) { |
80 | 80 | $getter = 'get'.ucfirst($name); |
@@ -90,7 +90,7 @@ discard block |
||
90 | 90 | return true; |
91 | 91 | } |
92 | 92 | // Reject misformed domains in any case |
93 | - if (strpos($domain,'-') === 0 || strpos($domain,'..') !== false) { |
|
93 | + if (strpos($domain, '-') === 0 || strpos($domain, '..') !== false) { |
|
94 | 94 | return false; |
95 | 95 | } |
96 | 96 | // Match, allowing for * wildcards |
@@ -98,9 +98,9 @@ discard block |
||
98 | 98 | if (gettype($trusted) !== 'string') { |
99 | 99 | break; |
100 | 100 | } |
101 | - $regex = '/^' . implode('[-\.a-zA-Z0-9]*', array_map(function ($v) { |
|
101 | + $regex = '/^'.implode('[-\.a-zA-Z0-9]*', array_map(function($v) { |
|
102 | 102 | return preg_quote($v, '/'); |
103 | - }, explode('*', $trusted))) . '$/i'; |
|
103 | + }, explode('*', $trusted))).'$/i'; |
|
104 | 104 | if (preg_match($regex, $domain) || preg_match($regex, $domainWithPort)) { |
105 | 105 | return true; |
106 | 106 | } |