@@ -126,12 +126,12 @@ discard block |
||
126 | 126 | } |
127 | 127 | |
128 | 128 | private function loadCustomDefinitions(string $fileName, array $definitions): array { |
129 | - if (file_exists($this->customConfigDir . '/' . $fileName)) { |
|
130 | - $custom = json_decode(file_get_contents($this->customConfigDir . '/' . $fileName), true); |
|
129 | + if (file_exists($this->customConfigDir.'/'.$fileName)) { |
|
130 | + $custom = json_decode(file_get_contents($this->customConfigDir.'/'.$fileName), true); |
|
131 | 131 | if (json_last_error() === JSON_ERROR_NONE) { |
132 | 132 | $definitions = array_merge($definitions, $custom); |
133 | 133 | } else { |
134 | - $this->logger->warning('Failed to parse ' . $fileName . ': ' . json_last_error_msg()); |
|
134 | + $this->logger->warning('Failed to parse '.$fileName.': '.json_last_error_msg()); |
|
135 | 135 | } |
136 | 136 | } |
137 | 137 | return $definitions; |
@@ -145,7 +145,7 @@ discard block |
||
145 | 145 | return; |
146 | 146 | } |
147 | 147 | |
148 | - $this->mimeTypeAlias = json_decode(file_get_contents($this->defaultConfigDir . '/mimetypealiases.dist.json'), true); |
|
148 | + $this->mimeTypeAlias = json_decode(file_get_contents($this->defaultConfigDir.'/mimetypealiases.dist.json'), true); |
|
149 | 149 | $this->mimeTypeAlias = $this->loadCustomDefinitions(self::CUSTOM_MIMETYPEALIASES, $this->mimeTypeAlias); |
150 | 150 | } |
151 | 151 | |
@@ -159,7 +159,7 @@ discard block |
||
159 | 159 | |
160 | 160 | public function getOnlyDefaultAliases(): array { |
161 | 161 | $this->loadMappings(); |
162 | - $this->mimeTypeAlias = json_decode(file_get_contents($this->defaultConfigDir . '/mimetypealiases.dist.json'), true); |
|
162 | + $this->mimeTypeAlias = json_decode(file_get_contents($this->defaultConfigDir.'/mimetypealiases.dist.json'), true); |
|
163 | 163 | return $this->mimeTypeAlias; |
164 | 164 | } |
165 | 165 | |
@@ -171,7 +171,7 @@ discard block |
||
171 | 171 | return; |
172 | 172 | } |
173 | 173 | |
174 | - $mimetypeMapping = json_decode(file_get_contents($this->defaultConfigDir . '/mimetypemapping.dist.json'), true); |
|
174 | + $mimetypeMapping = json_decode(file_get_contents($this->defaultConfigDir.'/mimetypemapping.dist.json'), true); |
|
175 | 175 | $mimetypeMapping = $this->loadCustomDefinitions(self::CUSTOM_MIMETYPEMAPPING, $mimetypeMapping); |
176 | 176 | |
177 | 177 | $this->registerTypeArray($mimetypeMapping); |
@@ -366,7 +366,7 @@ discard block |
||
366 | 366 | |
367 | 367 | // Icon exists? |
368 | 368 | try { |
369 | - $this->mimetypeIcons[$mimetype] = $this->urlGenerator->imagePath('core', 'filetypes/' . $icon . '.svg'); |
|
369 | + $this->mimetypeIcons[$mimetype] = $this->urlGenerator->imagePath('core', 'filetypes/'.$icon.'.svg'); |
|
370 | 370 | return $this->mimetypeIcons[$mimetype]; |
371 | 371 | } catch (\RuntimeException $e) { |
372 | 372 | // Specified image not found |
@@ -377,7 +377,7 @@ discard block |
||
377 | 377 | if (strpos($icon, '-')) { |
378 | 378 | $mimePart = substr($icon, 0, strpos($icon, '-')); |
379 | 379 | try { |
380 | - $this->mimetypeIcons[$mimetype] = $this->urlGenerator->imagePath('core', 'filetypes/' . $mimePart . '.svg'); |
|
380 | + $this->mimetypeIcons[$mimetype] = $this->urlGenerator->imagePath('core', 'filetypes/'.$mimePart.'.svg'); |
|
381 | 381 | return $this->mimetypeIcons[$mimetype]; |
382 | 382 | } catch (\RuntimeException $e) { |
383 | 383 | // Image for the first part of the mimetype not found |
@@ -50,7 +50,7 @@ |
||
50 | 50 | $eventName = 'OCA\Files_Sharing::loadAdditionalScripts'; |
51 | 51 | |
52 | 52 | if ($event->getScope() !== null) { |
53 | - $eventName .= '::' . $event->getScope(); |
|
53 | + $eventName .= '::'.$event->getScope(); |
|
54 | 54 | } |
55 | 55 | |
56 | 56 | $legacyEvent = new GenericEvent(null, ['share' => $event->getShare()]); |
@@ -103,7 +103,7 @@ discard block |
||
103 | 103 | |
104 | 104 | if (isset($this->namespaces[$namespace])) { |
105 | 105 | if (!isset($this->hasNoAppContainer[$namespace])) { |
106 | - $applicationClassName = 'OCA\\' . $sensitiveNamespace . '\\AppInfo\\Application'; |
|
106 | + $applicationClassName = 'OCA\\'.$sensitiveNamespace.'\\AppInfo\\Application'; |
|
107 | 107 | if (class_exists($applicationClassName)) { |
108 | 108 | $app = new $applicationClassName(); |
109 | 109 | if (isset($this->appContainers[$namespace])) { |
@@ -159,7 +159,7 @@ discard block |
||
159 | 159 | } |
160 | 160 | |
161 | 161 | try { |
162 | - [,$namespace,] = explode('\\', $id); |
|
162 | + [,$namespace, ] = explode('\\', $id); |
|
163 | 163 | return $this->getAppContainer(strtolower($namespace), $namespace); |
164 | 164 | } catch (QueryException $e) { |
165 | 165 | return null; |
@@ -84,13 +84,13 @@ discard block |
||
84 | 84 | public function startRegistration(IUser $user, string $serverHost): PublicKeyCredentialCreationOptions { |
85 | 85 | $rpEntity = new PublicKeyCredentialRpEntity( |
86 | 86 | 'Nextcloud', //Name |
87 | - $this->stripPort($serverHost), //ID |
|
87 | + $this->stripPort($serverHost), //ID |
|
88 | 88 | null //Icon |
89 | 89 | ); |
90 | 90 | |
91 | 91 | $userEntity = new PublicKeyCredentialUserEntity( |
92 | - $user->getUID(), //Name |
|
93 | - $user->getUID(), //ID |
|
92 | + $user->getUID(), //Name |
|
93 | + $user->getUID(), //ID |
|
94 | 94 | $user->getDisplayName() //Display name |
95 | 95 | // 'https://foo.example.co/avatar/123e4567-e89b-12d3-a456-426655440000' //Icon |
96 | 96 | ); |
@@ -177,7 +177,7 @@ discard block |
||
177 | 177 | |
178 | 178 | public function startAuthentication(string $uid, string $serverHost): PublicKeyCredentialRequestOptions { |
179 | 179 | // List of registered PublicKeyCredentialDescriptor classes associated to the user |
180 | - $registeredPublicKeyCredentialDescriptors = array_map(function (PublicKeyCredentialEntity $entity) { |
|
180 | + $registeredPublicKeyCredentialDescriptors = array_map(function(PublicKeyCredentialEntity $entity) { |
|
181 | 181 | $credential = $entity->toPublicKeyCredentialSource(); |
182 | 182 | return new PublicKeyCredentialDescriptor( |
183 | 183 | $credential->getType(), |
@@ -187,10 +187,10 @@ discard block |
||
187 | 187 | |
188 | 188 | // Public Key Credential Request Options |
189 | 189 | return new PublicKeyCredentialRequestOptions( |
190 | - random_bytes(32), // Challenge |
|
191 | - 60000, // Timeout |
|
192 | - $this->stripPort($serverHost), // Relying Party ID |
|
193 | - $registeredPublicKeyCredentialDescriptors, // Registered PublicKeyCredentialDescriptor classes |
|
190 | + random_bytes(32), // Challenge |
|
191 | + 60000, // Timeout |
|
192 | + $this->stripPort($serverHost), // Relying Party ID |
|
193 | + $registeredPublicKeyCredentialDescriptors, // Registered PublicKeyCredentialDescriptor classes |
|
194 | 194 | AuthenticatorSelectionCriteria::USER_VERIFICATION_REQUIREMENT_DISCOURAGED |
195 | 195 | ); |
196 | 196 | } |
@@ -216,7 +216,7 @@ discard block |
||
216 | 216 | ); |
217 | 217 | |
218 | 218 | try { |
219 | - $this->logger->debug('Loading publickey credentials from: ' . $data); |
|
219 | + $this->logger->debug('Loading publickey credentials from: '.$data); |
|
220 | 220 | |
221 | 221 | // Load the data |
222 | 222 | $publicKeyCredential = $publicKeyCredentialLoader->load($data); |
@@ -126,7 +126,7 @@ |
||
126 | 126 | $contact->setCard($parsed->serialize()); |
127 | 127 | } catch (Throwable $e) { |
128 | 128 | $this->logger->warning( |
129 | - 'Could not parse card to add recent category: ' . $e->getMessage(), |
|
129 | + 'Could not parse card to add recent category: '.$e->getMessage(), |
|
130 | 130 | [ |
131 | 131 | 'exception' => $e, |
132 | 132 | ]); |
@@ -63,7 +63,7 @@ discard block |
||
63 | 63 | /** |
64 | 64 | * Register $principalBackend for the DAV collection |
65 | 65 | */ |
66 | - $context->registerService('principalBackend', function (ContainerInterface $c) { |
|
66 | + $context->registerService('principalBackend', function(ContainerInterface $c) { |
|
67 | 67 | /** @var IServerContainer $server */ |
68 | 68 | $server = $c->get(IServerContainer::class); |
69 | 69 | return new Principal( |
@@ -77,7 +77,7 @@ discard block |
||
77 | 77 | ); |
78 | 78 | }); |
79 | 79 | |
80 | - $context->registerService(IVersionManager::class, function () { |
|
80 | + $context->registerService(IVersionManager::class, function() { |
|
81 | 81 | return new VersionManager(); |
82 | 82 | }); |
83 | 83 |
@@ -74,10 +74,10 @@ discard block |
||
74 | 74 | return -1; |
75 | 75 | } |
76 | 76 | if ($user) { |
77 | - $this->config->setUserValue($user, 'files_trashbin', 'trashbin_size', (string)$parsedSize); |
|
77 | + $this->config->setUserValue($user, 'files_trashbin', 'trashbin_size', (string) $parsedSize); |
|
78 | 78 | $this->commandBus->push(new Expire($user)); |
79 | 79 | } else { |
80 | - $this->config->setAppValue('files_trashbin', 'trashbin_size', (string)$parsedSize); |
|
80 | + $this->config->setAppValue('files_trashbin', 'trashbin_size', (string) $parsedSize); |
|
81 | 81 | $output->writeln("<info>Warning: changing the default trashbin size will automatically trigger cleanup of existing trashbins,</info>"); |
82 | 82 | $output->writeln("<info>a users trashbin can exceed the configured size until they move a new file to the trashbin.</info>"); |
83 | 83 | } |
@@ -89,7 +89,7 @@ discard block |
||
89 | 89 | } |
90 | 90 | |
91 | 91 | private function printTrashbinSize(InputInterface $input, OutputInterface $output, ?string $user) { |
92 | - $globalSize = (int)$this->config->getAppValue('files_trashbin', 'trashbin_size', '-1'); |
|
92 | + $globalSize = (int) $this->config->getAppValue('files_trashbin', 'trashbin_size', '-1'); |
|
93 | 93 | if ($globalSize < 0) { |
94 | 94 | $globalHumanSize = "default (50% of available space)"; |
95 | 95 | } else { |
@@ -97,7 +97,7 @@ discard block |
||
97 | 97 | } |
98 | 98 | |
99 | 99 | if ($user) { |
100 | - $userSize = (int)$this->config->getUserValue($user, 'files_trashbin', 'trashbin_size', '-1'); |
|
100 | + $userSize = (int) $this->config->getUserValue($user, 'files_trashbin', 'trashbin_size', '-1'); |
|
101 | 101 | |
102 | 102 | if ($userSize < 0) { |
103 | 103 | $userHumanSize = ($globalSize < 0) ? $globalHumanSize : "default($globalHumanSize)"; |
@@ -118,7 +118,7 @@ discard block |
||
118 | 118 | } |
119 | 119 | } else { |
120 | 120 | $users = []; |
121 | - $this->userManager->callForSeenUsers(function (IUser $user) use (&$users) { |
|
121 | + $this->userManager->callForSeenUsers(function(IUser $user) use (&$users) { |
|
122 | 122 | $users[] = $user->getUID(); |
123 | 123 | }); |
124 | 124 | $userValues = $this->config->getUserValueForUsers('files_trashbin', 'trashbin_size', $users); |
@@ -128,7 +128,7 @@ discard block |
||
128 | 128 | $output->writeln(""); |
129 | 129 | if (count($userValues)) { |
130 | 130 | $output->writeln("Per-user sizes:"); |
131 | - $this->writeArrayInOutputFormat($input, $output, array_map(function ($size) { |
|
131 | + $this->writeArrayInOutputFormat($input, $output, array_map(function($size) { |
|
132 | 132 | return \OC_Helper::humanFileSize($size); |
133 | 133 | }, $userValues)); |
134 | 134 | } else { |
@@ -6,5 +6,5 @@ |
||
6 | 6 | $baseDir = $vendorDir; |
7 | 7 | |
8 | 8 | return array( |
9 | - 'OCA\\UserStatus\\' => array($baseDir . '/../lib'), |
|
9 | + 'OCA\\UserStatus\\' => array($baseDir.'/../lib'), |
|
10 | 10 | ); |
@@ -370,18 +370,18 @@ discard block |
||
370 | 370 | private function findFileWithExtension($class, $ext) |
371 | 371 | { |
372 | 372 | // PSR-4 lookup |
373 | - $logicalPathPsr4 = strtr($class, '\\', DIRECTORY_SEPARATOR) . $ext; |
|
373 | + $logicalPathPsr4 = strtr($class, '\\', DIRECTORY_SEPARATOR).$ext; |
|
374 | 374 | |
375 | 375 | $first = $class[0]; |
376 | 376 | if (isset($this->prefixLengthsPsr4[$first])) { |
377 | 377 | $subPath = $class; |
378 | 378 | while (false !== $lastPos = strrpos($subPath, '\\')) { |
379 | 379 | $subPath = substr($subPath, 0, $lastPos); |
380 | - $search = $subPath . '\\'; |
|
380 | + $search = $subPath.'\\'; |
|
381 | 381 | if (isset($this->prefixDirsPsr4[$search])) { |
382 | - $pathEnd = DIRECTORY_SEPARATOR . substr($logicalPathPsr4, $lastPos + 1); |
|
382 | + $pathEnd = DIRECTORY_SEPARATOR.substr($logicalPathPsr4, $lastPos + 1); |
|
383 | 383 | foreach ($this->prefixDirsPsr4[$search] as $dir) { |
384 | - if (file_exists($file = $dir . $pathEnd)) { |
|
384 | + if (file_exists($file = $dir.$pathEnd)) { |
|
385 | 385 | return $file; |
386 | 386 | } |
387 | 387 | } |
@@ -391,7 +391,7 @@ discard block |
||
391 | 391 | |
392 | 392 | // PSR-4 fallback dirs |
393 | 393 | foreach ($this->fallbackDirsPsr4 as $dir) { |
394 | - if (file_exists($file = $dir . DIRECTORY_SEPARATOR . $logicalPathPsr4)) { |
|
394 | + if (file_exists($file = $dir.DIRECTORY_SEPARATOR.$logicalPathPsr4)) { |
|
395 | 395 | return $file; |
396 | 396 | } |
397 | 397 | } |
@@ -403,14 +403,14 @@ discard block |
||
403 | 403 | . strtr(substr($logicalPathPsr4, $pos + 1), '_', DIRECTORY_SEPARATOR); |
404 | 404 | } else { |
405 | 405 | // PEAR-like class name |
406 | - $logicalPathPsr0 = strtr($class, '_', DIRECTORY_SEPARATOR) . $ext; |
|
406 | + $logicalPathPsr0 = strtr($class, '_', DIRECTORY_SEPARATOR).$ext; |
|
407 | 407 | } |
408 | 408 | |
409 | 409 | if (isset($this->prefixesPsr0[$first])) { |
410 | 410 | foreach ($this->prefixesPsr0[$first] as $prefix => $dirs) { |
411 | 411 | if (0 === strpos($class, $prefix)) { |
412 | 412 | foreach ($dirs as $dir) { |
413 | - if (file_exists($file = $dir . DIRECTORY_SEPARATOR . $logicalPathPsr0)) { |
|
413 | + if (file_exists($file = $dir.DIRECTORY_SEPARATOR.$logicalPathPsr0)) { |
|
414 | 414 | return $file; |
415 | 415 | } |
416 | 416 | } |
@@ -420,7 +420,7 @@ discard block |
||
420 | 420 | |
421 | 421 | // PSR-0 fallback dirs |
422 | 422 | foreach ($this->fallbackDirsPsr0 as $dir) { |
423 | - if (file_exists($file = $dir . DIRECTORY_SEPARATOR . $logicalPathPsr0)) { |
|
423 | + if (file_exists($file = $dir.DIRECTORY_SEPARATOR.$logicalPathPsr0)) { |
|
424 | 424 | return $file; |
425 | 425 | } |
426 | 426 | } |