aboutsummaryrefslogtreecommitdiffstats
path: root/apps/files/lib/Command/RepairTree.php
diff options
context:
space:
mode:
Diffstat (limited to 'apps/files/lib/Command/RepairTree.php')
-rw-r--r--apps/files/lib/Command/RepairTree.php16
1 files changed, 6 insertions, 10 deletions
diff --git a/apps/files/lib/Command/RepairTree.php b/apps/files/lib/Command/RepairTree.php
index 521fe3d6a4a..7e7c40b4e00 100644
--- a/apps/files/lib/Command/RepairTree.php
+++ b/apps/files/lib/Command/RepairTree.php
@@ -33,17 +33,13 @@ use Symfony\Component\Console\Output\OutputInterface;
class RepairTree extends Command {
public const CHUNK_SIZE = 200;
- /**
- * @var IDBConnection
- */
- protected $connection;
-
- public function __construct(IDBConnection $connection) {
- $this->connection = $connection;
+ public function __construct(
+ protected IDBConnection $connection,
+ ) {
parent::__construct();
}
- protected function configure() {
+ protected function configure(): void {
$this
->setName('files:repair-tree')
->setDescription('Try and repair malformed filesystem tree structures')
@@ -90,7 +86,7 @@ class RepairTree extends Command {
$this->connection->commit();
}
- return 0;
+ return self::SUCCESS;
}
private function getFileId(int $storage, string $path) {
@@ -102,7 +98,7 @@ class RepairTree extends Command {
return $query->execute()->fetch(\PDO::FETCH_COLUMN);
}
- private function deleteById(int $fileId) {
+ private function deleteById(int $fileId): void {
$query = $this->connection->getQueryBuilder();
$query->delete('filecache')
->where($query->expr()->eq('fileid', $query->createNamedParameter($fileId)));