diff --git a/lib/private/DB/QueryBuilder/ExtendedQueryBuilder.php b/lib/private/DB/QueryBuilder/ExtendedQueryBuilder.php index c40cadfbdb5f6..f928132a123a8 100644 --- a/lib/private/DB/QueryBuilder/ExtendedQueryBuilder.php +++ b/lib/private/DB/QueryBuilder/ExtendedQueryBuilder.php @@ -289,12 +289,12 @@ public function executeStatement(?IDBConnection $connection = null): int { return $this->builder->executeStatement($connection); } - public function hintShardKey(string $column, mixed $value, bool $overwrite = false) { + public function hintShardKey(string $column, mixed $value, bool $overwrite = false): self { $this->builder->hintShardKey($column, $value, $overwrite); return $this; } - public function runAcrossAllShards() { + public function runAcrossAllShards(): self { $this->builder->runAcrossAllShards(); return $this; } diff --git a/lib/private/DB/QueryBuilder/QueryBuilder.php b/lib/private/DB/QueryBuilder/QueryBuilder.php index 6cdf97b01e9fc..3ee417733301e 100644 --- a/lib/private/DB/QueryBuilder/QueryBuilder.php +++ b/lib/private/DB/QueryBuilder/QueryBuilder.php @@ -560,7 +560,7 @@ public function addSelect(...$selects) { return $this; } - private function addOutputColumns(array $columns) { + private function addOutputColumns(array $columns): void { foreach ($columns as $column) { if (is_array($column)) { $this->addOutputColumns($column); @@ -1370,11 +1370,11 @@ public function escapeLikeParameter(string $parameter): string { return $this->connection->escapeLikeParameter($parameter); } - public function hintShardKey(string $column, mixed $value, bool $overwrite = false) { + public function hintShardKey(string $column, mixed $value, bool $overwrite = false): self { return $this; } - public function runAcrossAllShards() { + public function runAcrossAllShards(): self { // noop return $this; } diff --git a/lib/private/DB/QueryBuilder/Sharded/ShardedQueryBuilder.php b/lib/private/DB/QueryBuilder/Sharded/ShardedQueryBuilder.php index e7bc70ce440c3..e5b66470de08a 100644 --- a/lib/private/DB/QueryBuilder/Sharded/ShardedQueryBuilder.php +++ b/lib/private/DB/QueryBuilder/Sharded/ShardedQueryBuilder.php @@ -296,7 +296,7 @@ private function registerOrder(string $column, string $order): void { ]; } - public function hintShardKey(string $column, mixed $value, bool $overwrite = false) { + public function hintShardKey(string $column, mixed $value, bool $overwrite = false): self { if ($overwrite) { $this->primaryKeys = []; $this->shardKeys = []; @@ -310,7 +310,7 @@ public function hintShardKey(string $column, mixed $value, bool $overwrite = fal return $this; } - public function runAcrossAllShards() { + public function runAcrossAllShards(): self { $this->allShards = true; return $this; } diff --git a/lib/private/Files/Cache/Cache.php b/lib/private/Files/Cache/Cache.php index 0b0ff8ee4faa4..e1547fefe1cc5 100644 --- a/lib/private/Files/Cache/Cache.php +++ b/lib/private/Files/Cache/Cache.php @@ -1207,7 +1207,7 @@ public function getCacheEntryFromSearchResult(ICacheEntry $rawEntry): ?ICacheEnt } } - private function moveFromStorageSharded(ShardDefinition $shardDefinition, ICache $sourceCache, ICacheEntry $sourceEntry, $targetPath) { + private function moveFromStorageSharded(ShardDefinition $shardDefinition, ICache $sourceCache, ICacheEntry $sourceEntry, $targetPath): void { if ($sourceEntry->getMimeType() === ICacheEntry::DIRECTORY_MIMETYPE) { $fileIds = $this->getChildIds($sourceCache->getNumericStorageId(), $sourceEntry->getPath()); } else { diff --git a/lib/private/Memcache/Factory.php b/lib/private/Memcache/Factory.php index 931c871d0f140..370130912d676 100644 --- a/lib/private/Memcache/Factory.php +++ b/lib/private/Memcache/Factory.php @@ -6,6 +6,7 @@ */ namespace OC\Memcache; +use Closure; use OCP\Cache\CappedMemoryCache; use OCP\ICache; use OCP\ICacheFactory; @@ -40,7 +41,7 @@ class Factory implements ICacheFactory { private IProfiler $profiler; /** - * @param callable $globalPrefixClosure + * @param Closure $globalPrefixClosure * @param LoggerInterface $logger * @param ?class-string $localCacheClass * @param ?class-string $distributedCacheClass @@ -48,7 +49,7 @@ class Factory implements ICacheFactory { * @param string $logFile */ public function __construct( - private $globalPrefixClosure, + private Closure $globalPrefixClosure, LoggerInterface $logger, IProfiler $profiler, ?string $localCacheClass = null, diff --git a/lib/private/Preview/BackgroundCleanupJob.php b/lib/private/Preview/BackgroundCleanupJob.php index acf7bf22f5259..44832a78eb91f 100644 --- a/lib/private/Preview/BackgroundCleanupJob.php +++ b/lib/private/Preview/BackgroundCleanupJob.php @@ -16,7 +16,6 @@ use OCP\Files\NotFoundException; use OCP\Files\NotPermittedException; use OCP\IDBConnection; -use function Symfony\Component\Translation\t; class BackgroundCleanupJob extends TimedJob { /** @var IDBConnection */ diff --git a/lib/public/DB/QueryBuilder/IQueryBuilder.php b/lib/public/DB/QueryBuilder/IQueryBuilder.php index 22724c0c8005e..a965e0b5390ec 100644 --- a/lib/public/DB/QueryBuilder/IQueryBuilder.php +++ b/lib/public/DB/QueryBuilder/IQueryBuilder.php @@ -1040,7 +1040,7 @@ public function getColumnName($column, $tableAlias = ''); * @return $this * @since 30.0.0 */ - public function hintShardKey(string $column, mixed $value, bool $overwrite = false); + public function hintShardKey(string $column, mixed $value, bool $overwrite = false): self; /** * Set the query to run across all shards if sharding is enabled. @@ -1048,7 +1048,7 @@ public function hintShardKey(string $column, mixed $value, bool $overwrite = fal * @return $this * @since 30.0.0 */ - public function runAcrossAllShards(); + public function runAcrossAllShards(): self; /** * Get a list of column names that are expected in the query output diff --git a/tests/lib/DB/QueryBuilder/Partitioned/PartitionedQueryBuilderTest.php b/tests/lib/DB/QueryBuilder/Partitioned/PartitionedQueryBuilderTest.php index 88a3c1250449f..697b3ab92c980 100644 --- a/tests/lib/DB/QueryBuilder/Partitioned/PartitionedQueryBuilderTest.php +++ b/tests/lib/DB/QueryBuilder/Partitioned/PartitionedQueryBuilderTest.php @@ -51,7 +51,7 @@ private function getQueryBuilder(): PartitionedQueryBuilder { } } - private function setupFileCache() { + private function setupFileCache(): void { $this->cleanupDb(); $query = $this->getQueryBuilder(); $query->insert('storages') @@ -92,7 +92,7 @@ private function setupFileCache() { $query->executeStatement(); } - private function cleanupDb() { + private function cleanupDb(): void { $query = $this->getQueryBuilder(); $query->delete('storages') ->where($query->expr()->gt('numeric_id', $query->createNamedParameter(1000000, IQueryBuilder::PARAM_INT)));