aboutsummaryrefslogtreecommitdiffstats
path: root/lib/private/Repair
diff options
context:
space:
mode:
authorChristoph Wurst <christoph@winzerhof-wurst.at>2020-04-10 14:19:56 +0200
committerChristoph Wurst <christoph@winzerhof-wurst.at>2020-04-10 14:19:56 +0200
commitcaff1023ea72bb2ea94130e18a2a6e2ccf819e5f (patch)
tree186d494c2aea5dea7255d3584ef5d595fc6e6194 /lib/private/Repair
parentedf8ce32cffdb920e8171207b342abbd7f1fbe73 (diff)
downloadnextcloud-server-caff1023ea72bb2ea94130e18a2a6e2ccf819e5f.tar.gz
nextcloud-server-caff1023ea72bb2ea94130e18a2a6e2ccf819e5f.zip
Format control structures, classes, methods and function
To continue this formatting madness, here's a tiny patch that adds unified formatting for control structures like if and loops as well as classes, their methods and anonymous functions. This basically forces the constructs to start on the same line. This is not exactly what PSR2 wants, but I think we can have a few exceptions with "our" style. The starting of braces on the same line is pracrically standard for our code. This also removes and empty lines from method/function bodies at the beginning and end. Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
Diffstat (limited to 'lib/private/Repair')
-rw-r--r--lib/private/Repair/ClearGeneratedAvatarCache.php1
-rw-r--r--lib/private/Repair/MoveUpdaterStepFile.php11
-rw-r--r--lib/private/Repair/NC13/AddLogRotateJob.php1
-rw-r--r--lib/private/Repair/NC14/AddPreviewBackgroundCleanupJob.php1
-rw-r--r--lib/private/Repair/NC16/AddClenupLoginFlowV2BackgroundJob.php1
-rw-r--r--lib/private/Repair/Owncloud/SaveAccountsTableData.php2
-rw-r--r--lib/private/Repair/RemoveLinkShares.php2
-rw-r--r--lib/private/Repair/RepairInvalidShares.php1
-rw-r--r--lib/private/Repair/RepairMimeTypes.php1
9 files changed, 6 insertions, 15 deletions
diff --git a/lib/private/Repair/ClearGeneratedAvatarCache.php b/lib/private/Repair/ClearGeneratedAvatarCache.php
index 656dbcafaca..44a390d66a1 100644
--- a/lib/private/Repair/ClearGeneratedAvatarCache.php
+++ b/lib/private/Repair/ClearGeneratedAvatarCache.php
@@ -66,7 +66,6 @@ class ClearGeneratedAvatarCache implements IRepairStep {
} catch (\Exception $e) {
$output->warning('Unable to clear the avatar cache');
}
-
}
}
}
diff --git a/lib/private/Repair/MoveUpdaterStepFile.php b/lib/private/Repair/MoveUpdaterStepFile.php
index 481cff47e15..6be54bbb576 100644
--- a/lib/private/Repair/MoveUpdaterStepFile.php
+++ b/lib/private/Repair/MoveUpdaterStepFile.php
@@ -43,24 +43,23 @@ class MoveUpdaterStepFile implements IRepairStep {
}
public function run(IOutput $output) {
-
$dataDir = $this->config->getSystemValue('datadirectory', \OC::$SERVERROOT . '/data');
$instanceId = $this->config->getSystemValue('instanceid', null);
- if(!is_string($instanceId) || empty($instanceId)) {
+ if (!is_string($instanceId) || empty($instanceId)) {
return;
}
$updaterFolderPath = $dataDir . '/updater-' . $instanceId;
$stepFile = $updaterFolderPath . '/.step';
- if(file_exists($stepFile)) {
+ if (file_exists($stepFile)) {
$output->info('.step file exists');
$previousStepFile = $updaterFolderPath . '/.step-previous-update';
// cleanup
- if(file_exists($previousStepFile)) {
- if(\OC_Helper::rmdirr($previousStepFile)) {
+ if (file_exists($previousStepFile)) {
+ if (\OC_Helper::rmdirr($previousStepFile)) {
$output->info('.step-previous-update removed');
} else {
$output->info('.step-previous-update can\'t be removed - abort move of .step file');
@@ -69,7 +68,7 @@ class MoveUpdaterStepFile implements IRepairStep {
}
// move step file
- if(rename($stepFile, $previousStepFile)) {
+ if (rename($stepFile, $previousStepFile)) {
$output->info('.step file moved to .step-previous-update');
} else {
$output->warning('.step file can\'t be moved');
diff --git a/lib/private/Repair/NC13/AddLogRotateJob.php b/lib/private/Repair/NC13/AddLogRotateJob.php
index ceef8d0c7ee..7bd290894a4 100644
--- a/lib/private/Repair/NC13/AddLogRotateJob.php
+++ b/lib/private/Repair/NC13/AddLogRotateJob.php
@@ -44,5 +44,4 @@ class AddLogRotateJob implements IRepairStep {
public function run(IOutput $output) {
$this->jobList->add(Rotate::class);
}
-
}
diff --git a/lib/private/Repair/NC14/AddPreviewBackgroundCleanupJob.php b/lib/private/Repair/NC14/AddPreviewBackgroundCleanupJob.php
index f76e106dfac..f2958de5b96 100644
--- a/lib/private/Repair/NC14/AddPreviewBackgroundCleanupJob.php
+++ b/lib/private/Repair/NC14/AddPreviewBackgroundCleanupJob.php
@@ -47,5 +47,4 @@ class AddPreviewBackgroundCleanupJob implements IRepairStep {
public function run(IOutput $output) {
$this->jobList->add(BackgroundCleanupJob::class);
}
-
}
diff --git a/lib/private/Repair/NC16/AddClenupLoginFlowV2BackgroundJob.php b/lib/private/Repair/NC16/AddClenupLoginFlowV2BackgroundJob.php
index 5b8712fff85..34afd5dea60 100644
--- a/lib/private/Repair/NC16/AddClenupLoginFlowV2BackgroundJob.php
+++ b/lib/private/Repair/NC16/AddClenupLoginFlowV2BackgroundJob.php
@@ -47,5 +47,4 @@ class AddClenupLoginFlowV2BackgroundJob implements IRepairStep {
public function run(IOutput $output) {
$this->jobList->add(CleanupLoginFlowV2::class);
}
-
}
diff --git a/lib/private/Repair/Owncloud/SaveAccountsTableData.php b/lib/private/Repair/Owncloud/SaveAccountsTableData.php
index 12515f2e882..6dd49e6c9fd 100644
--- a/lib/private/Repair/Owncloud/SaveAccountsTableData.php
+++ b/lib/private/Repair/Owncloud/SaveAccountsTableData.php
@@ -35,7 +35,6 @@ use OCP\PreConditionNotMetException;
* before the data structure is changed and the information is gone
*/
class SaveAccountsTableData implements IRepairStep {
-
const BATCH_SIZE = 75;
/** @var IDBConnection */
@@ -186,6 +185,5 @@ class SaveAccountsTableData implements IRepairStep {
->setParameter('userid', $userdata['user_id']);
$update->execute();
}
-
}
}
diff --git a/lib/private/Repair/RemoveLinkShares.php b/lib/private/Repair/RemoveLinkShares.php
index 580c9567f34..319fb80277c 100644
--- a/lib/private/Repair/RemoveLinkShares.php
+++ b/lib/private/Repair/RemoveLinkShares.php
@@ -210,7 +210,7 @@ class RemoveLinkShares implements IRepairStep {
$output->startProgress($total);
$shareCursor = $this->getShares();
- while($data = $shareCursor->fetch()) {
+ while ($data = $shareCursor->fetch()) {
$this->processShare($data);
$output->advance();
}
diff --git a/lib/private/Repair/RepairInvalidShares.php b/lib/private/Repair/RepairInvalidShares.php
index cb71bef9ffa..becf8ba7594 100644
--- a/lib/private/Repair/RepairInvalidShares.php
+++ b/lib/private/Repair/RepairInvalidShares.php
@@ -32,7 +32,6 @@ use OCP\Migration\IRepairStep;
* Repairs shares with invalid data
*/
class RepairInvalidShares implements IRepairStep {
-
const CHUNK_SIZE = 200;
/** @var \OCP\IConfig */
diff --git a/lib/private/Repair/RepairMimeTypes.php b/lib/private/Repair/RepairMimeTypes.php
index 67dd1ca971d..b6b6ceed104 100644
--- a/lib/private/Repair/RepairMimeTypes.php
+++ b/lib/private/Repair/RepairMimeTypes.php
@@ -195,7 +195,6 @@ class RepairMimeTypes implements IRepairStep {
* Fix mime types
*/
public function run(IOutput $out) {
-
$ocVersionFromBeforeUpdate = $this->config->getSystemValue('version', '0.0.0');
// NOTE TO DEVELOPERS: when adding new mime types, please make sure to