diff options
Diffstat (limited to 'lib/private')
-rw-r--r-- | lib/private/AppConfig.php | 2 | ||||
-rw-r--r-- | lib/private/Comments/Manager.php | 2 | ||||
-rw-r--r-- | lib/private/DB/QueryBuilder/Sharded/AutoIncrementHandler.php | 4 | ||||
-rw-r--r-- | lib/private/Files/Cache/SearchBuilder.php | 2 | ||||
-rw-r--r-- | lib/private/Migration/MetadataManager.php | 2 | ||||
-rw-r--r-- | lib/private/Search/SearchQuery.php | 2 | ||||
-rw-r--r-- | lib/private/Security/Ip/Address.php | 2 | ||||
-rw-r--r-- | lib/private/Share20/Manager.php | 4 | ||||
-rw-r--r-- | lib/private/TaskProcessing/Manager.php | 10 | ||||
-rw-r--r-- | lib/private/TaskProcessing/RemoveOldTasksBackgroundJob.php | 2 | ||||
-rw-r--r-- | lib/private/Template/JSConfigHelper.php | 2 | ||||
-rw-r--r-- | lib/private/TextToImage/Manager.php | 6 | ||||
-rw-r--r-- | lib/private/TextToImage/RemoveOldTasksBackgroundJob.php | 2 | ||||
-rw-r--r-- | lib/private/User/Manager.php | 2 |
14 files changed, 22 insertions, 22 deletions
diff --git a/lib/private/AppConfig.php b/lib/private/AppConfig.php index c27150a67dc..f6361ff2ac6 100644 --- a/lib/private/AppConfig.php +++ b/lib/private/AppConfig.php @@ -1378,7 +1378,7 @@ class AppConfig implements IAppConfig { * @return array<string, string|int|float|bool|array> */ private function formatAppValues(string $app, array $values, ?bool $lazy = null): array { - foreach($values as $key => $value) { + foreach ($values as $key => $value) { try { $type = $this->getValueType($app, $key, $lazy); } catch (AppConfigUnknownKeyException $e) { diff --git a/lib/private/Comments/Manager.php b/lib/private/Comments/Manager.php index 9237c884691..8b7f43c03a2 100644 --- a/lib/private/Comments/Manager.php +++ b/lib/private/Comments/Manager.php @@ -132,7 +132,7 @@ class Manager implements ICommentsManager { try { $comment->getCreationDateTime(); - } catch(\LogicException $e) { + } catch (\LogicException $e) { $comment->setCreationDateTime(new \DateTime()); } diff --git a/lib/private/DB/QueryBuilder/Sharded/AutoIncrementHandler.php b/lib/private/DB/QueryBuilder/Sharded/AutoIncrementHandler.php index d40934669d7..c3ce28376e3 100644 --- a/lib/private/DB/QueryBuilder/Sharded/AutoIncrementHandler.php +++ b/lib/private/DB/QueryBuilder/Sharded/AutoIncrementHandler.php @@ -34,7 +34,7 @@ class AutoIncrementHandler { } private function getCache(): IMemcache { - if(is_null($this->cache)) { + if (is_null($this->cache)) { $cache = $this->cacheFactory->createDistributed('shared_autoincrement'); if ($cache instanceof IMemcache) { $this->cache = $cache; @@ -118,7 +118,7 @@ class AutoIncrementHandler { $next = $cache->inc($shardDefinition->table); if (is_int($next) && $next >= self::MIN_VALID_KEY) { return $next; - } elseif(is_int($next)) { + } elseif (is_int($next)) { // key got cleared, invalidate and retry $cache->cas($shardDefinition->table, $next, 'empty-placeholder'); return null; diff --git a/lib/private/Files/Cache/SearchBuilder.php b/lib/private/Files/Cache/SearchBuilder.php index 32502cb8258..748844b9e1b 100644 --- a/lib/private/Files/Cache/SearchBuilder.php +++ b/lib/private/Files/Cache/SearchBuilder.php @@ -290,7 +290,7 @@ class SearchBuilder { $value = $operator->getValue(); $type = $operator->getType(); - switch($operator->getExtra()) { + switch ($operator->getExtra()) { case IMetadataQuery::EXTRA: $metadataQuery->joinIndex($field); // join index table if not joined yet $field = $metadataQuery->getMetadataValueField($field); diff --git a/lib/private/Migration/MetadataManager.php b/lib/private/Migration/MetadataManager.php index 324c169c626..cdaa604ce5a 100644 --- a/lib/private/Migration/MetadataManager.php +++ b/lib/private/Migration/MetadataManager.php @@ -43,7 +43,7 @@ class MetadataManager { $ms = new MigrationService($appId, $this->connection); $metadata = []; - foreach($ms->getAvailableVersions() as $version) { + foreach ($ms->getAvailableVersions() as $version) { $metadata[$version] = []; $class = new ReflectionClass($ms->createInstance($version)); $attributes = $class->getAttributes(); diff --git a/lib/private/Search/SearchQuery.php b/lib/private/Search/SearchQuery.php index a78443922ae..791edb7a0f7 100644 --- a/lib/private/Search/SearchQuery.php +++ b/lib/private/Search/SearchQuery.php @@ -25,7 +25,7 @@ class SearchQuery implements ISearchQuery { private int $limit = self::LIMIT_DEFAULT, private int|string|null $cursor = null, private string $route = '', - private array $routeParameters = [], + private array $routeParameters = [], ) { } diff --git a/lib/private/Security/Ip/Address.php b/lib/private/Security/Ip/Address.php index b4f12a7e295..1df94e0a9c7 100644 --- a/lib/private/Security/Ip/Address.php +++ b/lib/private/Security/Ip/Address.php @@ -33,7 +33,7 @@ class Address implements IAddress { } public function matches(IRange... $ranges): bool { - foreach($ranges as $range) { + foreach ($ranges as $range) { if ($range->contains($this)) { return true; } diff --git a/lib/private/Share20/Manager.php b/lib/private/Share20/Manager.php index 391b77171a9..bb34468db6e 100644 --- a/lib/private/Share20/Manager.php +++ b/lib/private/Share20/Manager.php @@ -275,7 +275,7 @@ class Manager implements IManager { // If $expirationDate is falsy, noExpirationDate is true and expiration not enforced // Then skip expiration date validation as null is accepted - if(!$share->getNoExpirationDate() || $isEnforced) { + if (!$share->getNoExpirationDate() || $isEnforced) { if ($expirationDate !== null) { $expirationDate->setTimezone($this->dateTimeZone->getTimeZone()); $expirationDate->setTime(0, 0, 0); @@ -353,7 +353,7 @@ class Manager implements IManager { // If $expirationDate is falsy, noExpirationDate is true and expiration not enforced // Then skip expiration date validation as null is accepted - if(!($share->getNoExpirationDate() && !$isEnforced)) { + if (!($share->getNoExpirationDate() && !$isEnforced)) { if ($expirationDate !== null) { $expirationDate->setTimezone($this->dateTimeZone->getTimeZone()); $expirationDate->setTime(0, 0, 0); diff --git a/lib/private/TaskProcessing/Manager.php b/lib/private/TaskProcessing/Manager.php index fb0a4da4c4e..1b170a03ec2 100644 --- a/lib/private/TaskProcessing/Manager.php +++ b/lib/private/TaskProcessing/Manager.php @@ -175,7 +175,7 @@ class Manager implements IManager { } try { return ['output' => $this->provider->process($input['input'])]; - } catch(\RuntimeException $e) { + } catch (\RuntimeException $e) { throw new ProcessingException($e->getMessage(), 0, $e); } } @@ -306,7 +306,7 @@ class Manager implements IManager { public function process(?string $userId, array $input, callable $reportProgress): array { try { $folder = $this->appData->getFolder('text2image'); - } catch(\OCP\Files\NotFoundException) { + } catch (\OCP\Files\NotFoundException) { $folder = $this->appData->newFolder('text2image'); } $resources = []; @@ -994,7 +994,7 @@ class Manager implements IManager { } $newInputOutput = []; $spec = array_reduce($specs, fn ($carry, $spec) => $carry + $spec, []); - foreach($spec as $key => $descriptor) { + foreach ($spec as $key => $descriptor) { $type = $descriptor->getShapeType(); if (!isset($input[$key])) { continue; @@ -1086,7 +1086,7 @@ class Manager implements IManager { $folder = $this->appData->newFolder('TaskProcessing'); } $spec = array_reduce($specs, fn ($carry, $spec) => $carry + $spec, []); - foreach($spec as $key => $descriptor) { + foreach ($spec as $key => $descriptor) { $type = $descriptor->getShapeType(); if (!isset($output[$key])) { continue; @@ -1231,7 +1231,7 @@ class Manager implements IManager { private function validateOutputFileIds(array $output, ...$specs): array { $newOutput = []; $spec = array_reduce($specs, fn ($carry, $spec) => $carry + $spec, []); - foreach($spec as $key => $descriptor) { + foreach ($spec as $key => $descriptor) { $type = $descriptor->getShapeType(); if (!isset($output[$key])) { continue; diff --git a/lib/private/TaskProcessing/RemoveOldTasksBackgroundJob.php b/lib/private/TaskProcessing/RemoveOldTasksBackgroundJob.php index 823ea09a622..acec2f46c05 100644 --- a/lib/private/TaskProcessing/RemoveOldTasksBackgroundJob.php +++ b/lib/private/TaskProcessing/RemoveOldTasksBackgroundJob.php @@ -65,7 +65,7 @@ class RemoveOldTasksBackgroundJob extends TimedJob { * @return void */ private function clearFilesOlderThan(ISimpleFolder $folder, int $ageInSeconds): void { - foreach($folder->getDirectoryListing() as $file) { + foreach ($folder->getDirectoryListing() as $file) { if ($file->getMTime() < time() - $ageInSeconds) { try { $file->delete(); diff --git a/lib/private/Template/JSConfigHelper.php b/lib/private/Template/JSConfigHelper.php index 55fb348f01b..a4984eaf930 100644 --- a/lib/private/Template/JSConfigHelper.php +++ b/lib/private/Template/JSConfigHelper.php @@ -281,7 +281,7 @@ class JSConfigHelper { $result = ''; // Echo it - foreach ($array as $setting => $value) { + foreach ($array as $setting => $value) { $result .= 'var '. $setting . '='. $value . ';' . PHP_EOL; } diff --git a/lib/private/TextToImage/Manager.php b/lib/private/TextToImage/Manager.php index 2d6cc6450a1..88dc108f380 100644 --- a/lib/private/TextToImage/Manager.php +++ b/lib/private/TextToImage/Manager.php @@ -119,13 +119,13 @@ class Manager implements IManager { } try { $folder = $this->appData->getFolder('text2image'); - } catch(NotFoundException) { + } catch (NotFoundException) { $this->logger->debug('Creating folder in appdata for Text2Image results'); $folder = $this->appData->newFolder('text2image'); } try { $folder = $folder->getFolder((string)$task->getId()); - } catch(NotFoundException) { + } catch (NotFoundException) { $this->logger->debug('Creating new folder in appdata Text2Image results folder'); $folder = $folder->newFolder((string)$task->getId()); } @@ -162,7 +162,7 @@ class Manager implements IManager { if (isset($files, $files[$i])) { try { $files[$i]->delete(); - } catch(NotPermittedException $e) { + } catch (NotPermittedException $e) { $this->logger->warning('Failed to clean up Text2Image result file after error', ['exception' => $e]); } } diff --git a/lib/private/TextToImage/RemoveOldTasksBackgroundJob.php b/lib/private/TextToImage/RemoveOldTasksBackgroundJob.php index 525d68df22b..7d9170090b7 100644 --- a/lib/private/TextToImage/RemoveOldTasksBackgroundJob.php +++ b/lib/private/TextToImage/RemoveOldTasksBackgroundJob.php @@ -55,7 +55,7 @@ class RemoveOldTasksBackgroundJob extends TimedJob { } } catch (Exception $e) { $this->logger->warning('Failed to delete stale text to image tasks', ['exception' => $e]); - } catch(NotFoundException) { + } catch (NotFoundException) { // noop } } diff --git a/lib/private/User/Manager.php b/lib/private/User/Manager.php index 96be58a84a2..9a84b102a99 100644 --- a/lib/private/User/Manager.php +++ b/lib/private/User/Manager.php @@ -751,7 +751,7 @@ class Manager extends PublicEmitter implements IUserManager { $queryBuilder->expr()->eq('p.appid', $queryBuilder->expr()->literal('login')), $queryBuilder->expr()->eq('p.configkey', $queryBuilder->expr()->literal('lastLogin'))) ); - if($search !== '') { + if ($search !== '') { $queryBuilder->leftJoin('u', 'preferences', 'p1', $queryBuilder->expr()->andX( $queryBuilder->expr()->eq('p1.userid', 'uid'), $queryBuilder->expr()->eq('p1.appid', $queryBuilder->expr()->literal('settings')), |