summaryrefslogtreecommitdiffstats
path: root/apps/twofactor_backupcodes
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 /apps/twofactor_backupcodes
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 'apps/twofactor_backupcodes')
-rw-r--r--apps/twofactor_backupcodes/lib/Activity/Provider.php1
-rw-r--r--apps/twofactor_backupcodes/lib/BackgroundJob/CheckBackupCodes.php1
-rw-r--r--apps/twofactor_backupcodes/lib/Controller/SettingsController.php1
-rw-r--r--apps/twofactor_backupcodes/lib/Db/BackupCode.php1
-rw-r--r--apps/twofactor_backupcodes/lib/Db/BackupCodeMapper.php2
-rw-r--r--apps/twofactor_backupcodes/lib/Event/CodesGenerated.php1
-rw-r--r--apps/twofactor_backupcodes/lib/Listener/ActivityPublisher.php1
-rw-r--r--apps/twofactor_backupcodes/lib/Listener/ProviderDisabled.php1
-rw-r--r--apps/twofactor_backupcodes/lib/Listener/ProviderEnabled.php1
-rw-r--r--apps/twofactor_backupcodes/lib/Listener/RegistryUpdater.php1
-rw-r--r--apps/twofactor_backupcodes/lib/Migration/CheckBackupCodes.php1
-rw-r--r--apps/twofactor_backupcodes/lib/Migration/Version1002Date20170926101419.php1
-rw-r--r--apps/twofactor_backupcodes/lib/Migration/Version1002Date20180821043638.php1
-rw-r--r--apps/twofactor_backupcodes/lib/Provider/BackupCodesProvider.php1
-rw-r--r--apps/twofactor_backupcodes/lib/Service/BackupCodeStorage.php2
-rw-r--r--apps/twofactor_backupcodes/lib/Settings/Personal.php1
-rw-r--r--apps/twofactor_backupcodes/tests/Db/BackupCodeMapperTest.php1
-rw-r--r--apps/twofactor_backupcodes/tests/Service/BackupCodeStorageTest.php1
-rw-r--r--apps/twofactor_backupcodes/tests/Unit/Activity/ProviderTest.php1
-rw-r--r--apps/twofactor_backupcodes/tests/Unit/BackgroundJob/CheckBackupCodeTest.php2
-rw-r--r--apps/twofactor_backupcodes/tests/Unit/Controller/SettingsControllerTest.php1
-rw-r--r--apps/twofactor_backupcodes/tests/Unit/Event/CodesGeneratedTest.php1
-rw-r--r--apps/twofactor_backupcodes/tests/Unit/Listener/ActivityPublisherTest.php1
-rw-r--r--apps/twofactor_backupcodes/tests/Unit/Provider/BackupCodesProviderTest.php1
-rw-r--r--apps/twofactor_backupcodes/tests/Unit/Service/BackupCodeStorageTest.php1
25 files changed, 0 insertions, 28 deletions
diff --git a/apps/twofactor_backupcodes/lib/Activity/Provider.php b/apps/twofactor_backupcodes/lib/Activity/Provider.php
index ac62ebabd05..12c71f68d1c 100644
--- a/apps/twofactor_backupcodes/lib/Activity/Provider.php
+++ b/apps/twofactor_backupcodes/lib/Activity/Provider.php
@@ -75,5 +75,4 @@ class Provider implements IProvider {
}
return $event;
}
-
}
diff --git a/apps/twofactor_backupcodes/lib/BackgroundJob/CheckBackupCodes.php b/apps/twofactor_backupcodes/lib/BackgroundJob/CheckBackupCodes.php
index 61dbffb3214..5d6d428cecc 100644
--- a/apps/twofactor_backupcodes/lib/BackgroundJob/CheckBackupCodes.php
+++ b/apps/twofactor_backupcodes/lib/BackgroundJob/CheckBackupCodes.php
@@ -66,5 +66,4 @@ class CheckBackupCodes extends QueuedJob {
}
});
}
-
}
diff --git a/apps/twofactor_backupcodes/lib/Controller/SettingsController.php b/apps/twofactor_backupcodes/lib/Controller/SettingsController.php
index 2d87af3183f..04ec2e19e95 100644
--- a/apps/twofactor_backupcodes/lib/Controller/SettingsController.php
+++ b/apps/twofactor_backupcodes/lib/Controller/SettingsController.php
@@ -64,5 +64,4 @@ class SettingsController extends Controller {
'state' => $this->storage->getBackupCodesState($user),
]);
}
-
}
diff --git a/apps/twofactor_backupcodes/lib/Db/BackupCode.php b/apps/twofactor_backupcodes/lib/Db/BackupCode.php
index bbd40bf3643..02d1932d50b 100644
--- a/apps/twofactor_backupcodes/lib/Db/BackupCode.php
+++ b/apps/twofactor_backupcodes/lib/Db/BackupCode.php
@@ -44,5 +44,4 @@ class BackupCode extends Entity {
/** @var int */
protected $used;
-
}
diff --git a/apps/twofactor_backupcodes/lib/Db/BackupCodeMapper.php b/apps/twofactor_backupcodes/lib/Db/BackupCodeMapper.php
index 73883b3eb30..48c3fd6a84d 100644
--- a/apps/twofactor_backupcodes/lib/Db/BackupCodeMapper.php
+++ b/apps/twofactor_backupcodes/lib/Db/BackupCodeMapper.php
@@ -31,7 +31,6 @@ use OCP\IDBConnection;
use OCP\IUser;
class BackupCodeMapper extends QBMapper {
-
public function __construct(IDBConnection $db) {
parent::__construct($db, 'twofactor_backupcodes');
}
@@ -69,5 +68,4 @@ class BackupCodeMapper extends QBMapper {
->where($qb->expr()->eq('user_id', $qb->createNamedParameter($uid)));
$qb->execute();
}
-
}
diff --git a/apps/twofactor_backupcodes/lib/Event/CodesGenerated.php b/apps/twofactor_backupcodes/lib/Event/CodesGenerated.php
index 7db29bdf765..d1e5e29d4b5 100644
--- a/apps/twofactor_backupcodes/lib/Event/CodesGenerated.php
+++ b/apps/twofactor_backupcodes/lib/Event/CodesGenerated.php
@@ -45,5 +45,4 @@ class CodesGenerated extends Event {
public function getUser(): IUser {
return $this->user;
}
-
}
diff --git a/apps/twofactor_backupcodes/lib/Listener/ActivityPublisher.php b/apps/twofactor_backupcodes/lib/Listener/ActivityPublisher.php
index 99dd39b5b1d..d7240677b6c 100644
--- a/apps/twofactor_backupcodes/lib/Listener/ActivityPublisher.php
+++ b/apps/twofactor_backupcodes/lib/Listener/ActivityPublisher.php
@@ -66,5 +66,4 @@ class ActivityPublisher implements IEventListener {
}
}
}
-
}
diff --git a/apps/twofactor_backupcodes/lib/Listener/ProviderDisabled.php b/apps/twofactor_backupcodes/lib/Listener/ProviderDisabled.php
index 9dfecee0df7..f3242aa8c8a 100644
--- a/apps/twofactor_backupcodes/lib/Listener/ProviderDisabled.php
+++ b/apps/twofactor_backupcodes/lib/Listener/ProviderDisabled.php
@@ -64,5 +64,4 @@ class ProviderDisabled implements IEventListener {
$this->jobList->remove(RememberBackupCodesJob::class, ['uid' => $event->getUser()->getUID()]);
}
}
-
}
diff --git a/apps/twofactor_backupcodes/lib/Listener/ProviderEnabled.php b/apps/twofactor_backupcodes/lib/Listener/ProviderEnabled.php
index de3d52ef436..d43af2e4590 100644
--- a/apps/twofactor_backupcodes/lib/Listener/ProviderEnabled.php
+++ b/apps/twofactor_backupcodes/lib/Listener/ProviderEnabled.php
@@ -61,5 +61,4 @@ class ProviderEnabled implements IEventListener {
$this->jobList->add(RememberBackupCodesJob::class, ['uid' => $event->getUser()->getUID()]);
}
-
}
diff --git a/apps/twofactor_backupcodes/lib/Listener/RegistryUpdater.php b/apps/twofactor_backupcodes/lib/Listener/RegistryUpdater.php
index 48e231facb3..011950a0979 100644
--- a/apps/twofactor_backupcodes/lib/Listener/RegistryUpdater.php
+++ b/apps/twofactor_backupcodes/lib/Listener/RegistryUpdater.php
@@ -50,5 +50,4 @@ class RegistryUpdater implements IEventListener {
$this->registry->enableProviderFor($this->provider, $event->getUser());
}
}
-
}
diff --git a/apps/twofactor_backupcodes/lib/Migration/CheckBackupCodes.php b/apps/twofactor_backupcodes/lib/Migration/CheckBackupCodes.php
index d5b3758f37f..e43a99b9e0a 100644
--- a/apps/twofactor_backupcodes/lib/Migration/CheckBackupCodes.php
+++ b/apps/twofactor_backupcodes/lib/Migration/CheckBackupCodes.php
@@ -46,5 +46,4 @@ class CheckBackupCodes implements IRepairStep {
public function run(IOutput $output) {
$this->jobList->add(\OCA\TwoFactorBackupCodes\BackgroundJob\CheckBackupCodes::class);
}
-
}
diff --git a/apps/twofactor_backupcodes/lib/Migration/Version1002Date20170926101419.php b/apps/twofactor_backupcodes/lib/Migration/Version1002Date20170926101419.php
index cd922454ea0..f8df9e69844 100644
--- a/apps/twofactor_backupcodes/lib/Migration/Version1002Date20170926101419.php
+++ b/apps/twofactor_backupcodes/lib/Migration/Version1002Date20170926101419.php
@@ -40,5 +40,4 @@ class Version1002Date20170926101419 extends BigIntMigration {
'twofactor_backupcodes' => ['id'],
];
}
-
}
diff --git a/apps/twofactor_backupcodes/lib/Migration/Version1002Date20180821043638.php b/apps/twofactor_backupcodes/lib/Migration/Version1002Date20180821043638.php
index 3cbadb455a6..1138bcd6bd2 100644
--- a/apps/twofactor_backupcodes/lib/Migration/Version1002Date20180821043638.php
+++ b/apps/twofactor_backupcodes/lib/Migration/Version1002Date20180821043638.php
@@ -50,5 +50,4 @@ class Version1002Date20180821043638 extends SimpleMigrationStep {
return $schema;
}
-
}
diff --git a/apps/twofactor_backupcodes/lib/Provider/BackupCodesProvider.php b/apps/twofactor_backupcodes/lib/Provider/BackupCodesProvider.php
index 6d60f589e52..9b7ce1ed7de 100644
--- a/apps/twofactor_backupcodes/lib/Provider/BackupCodesProvider.php
+++ b/apps/twofactor_backupcodes/lib/Provider/BackupCodesProvider.php
@@ -165,5 +165,4 @@ class BackupCodesProvider implements IProvider, IProvidesPersonalSettings {
$this->initialStateService->provideInitialState($this->appName, 'state', $state);
return new Personal();
}
-
}
diff --git a/apps/twofactor_backupcodes/lib/Service/BackupCodeStorage.php b/apps/twofactor_backupcodes/lib/Service/BackupCodeStorage.php
index ffb456792a4..fb604d80aab 100644
--- a/apps/twofactor_backupcodes/lib/Service/BackupCodeStorage.php
+++ b/apps/twofactor_backupcodes/lib/Service/BackupCodeStorage.php
@@ -34,7 +34,6 @@ use OCP\Security\IHasher;
use OCP\Security\ISecureRandom;
class BackupCodeStorage {
-
private static $CODE_LENGTH = 16;
/** @var BackupCodeMapper */
@@ -133,5 +132,4 @@ class BackupCodeStorage {
}
return false;
}
-
}
diff --git a/apps/twofactor_backupcodes/lib/Settings/Personal.php b/apps/twofactor_backupcodes/lib/Settings/Personal.php
index e7cfcb77ca6..062016d0d05 100644
--- a/apps/twofactor_backupcodes/lib/Settings/Personal.php
+++ b/apps/twofactor_backupcodes/lib/Settings/Personal.php
@@ -35,5 +35,4 @@ class Personal implements IPersonalProviderSettings {
public function getBody(): Template {
return new Template('twofactor_backupcodes', 'personal');
}
-
}
diff --git a/apps/twofactor_backupcodes/tests/Db/BackupCodeMapperTest.php b/apps/twofactor_backupcodes/tests/Db/BackupCodeMapperTest.php
index 89cd88e05e3..ae5a10232e9 100644
--- a/apps/twofactor_backupcodes/tests/Db/BackupCodeMapperTest.php
+++ b/apps/twofactor_backupcodes/tests/Db/BackupCodeMapperTest.php
@@ -120,5 +120,4 @@ class BackupCodeMapperTest extends TestCase {
$this->mapper->insert($code);
}
-
}
diff --git a/apps/twofactor_backupcodes/tests/Service/BackupCodeStorageTest.php b/apps/twofactor_backupcodes/tests/Service/BackupCodeStorageTest.php
index 8cd20df85a7..dbfc6fa70e1 100644
--- a/apps/twofactor_backupcodes/tests/Service/BackupCodeStorageTest.php
+++ b/apps/twofactor_backupcodes/tests/Service/BackupCodeStorageTest.php
@@ -107,5 +107,4 @@ class BackupCodeStorageTest extends TestCase {
];
$this->assertEquals($stateAllUsed, $this->storage->getBackupCodesState($user));
}
-
}
diff --git a/apps/twofactor_backupcodes/tests/Unit/Activity/ProviderTest.php b/apps/twofactor_backupcodes/tests/Unit/Activity/ProviderTest.php
index 050d5d06a5a..464b65dbebb 100644
--- a/apps/twofactor_backupcodes/tests/Unit/Activity/ProviderTest.php
+++ b/apps/twofactor_backupcodes/tests/Unit/Activity/ProviderTest.php
@@ -130,5 +130,4 @@ class ProviderTest extends TestCase {
$this->expectException(InvalidArgumentException::class);
$this->provider->parse($lang, $event);
}
-
}
diff --git a/apps/twofactor_backupcodes/tests/Unit/BackgroundJob/CheckBackupCodeTest.php b/apps/twofactor_backupcodes/tests/Unit/BackgroundJob/CheckBackupCodeTest.php
index 3b443c9fe6b..43873e6cc89 100644
--- a/apps/twofactor_backupcodes/tests/Unit/BackgroundJob/CheckBackupCodeTest.php
+++ b/apps/twofactor_backupcodes/tests/Unit/BackgroundJob/CheckBackupCodeTest.php
@@ -133,6 +133,4 @@ class CheckBackupCodeTest extends TestCase {
$this->invokePrivate($this->checkBackupCodes, 'run', [[]]);
}
-
-
}
diff --git a/apps/twofactor_backupcodes/tests/Unit/Controller/SettingsControllerTest.php b/apps/twofactor_backupcodes/tests/Unit/Controller/SettingsControllerTest.php
index 95d94e4fc0d..1ced1dbf684 100644
--- a/apps/twofactor_backupcodes/tests/Unit/Controller/SettingsControllerTest.php
+++ b/apps/twofactor_backupcodes/tests/Unit/Controller/SettingsControllerTest.php
@@ -83,5 +83,4 @@ class SettingsControllerTest extends TestCase {
$this->assertInstanceOf(JSONResponse::class, $response);
$this->assertEquals($expected, $response->getData());
}
-
}
diff --git a/apps/twofactor_backupcodes/tests/Unit/Event/CodesGeneratedTest.php b/apps/twofactor_backupcodes/tests/Unit/Event/CodesGeneratedTest.php
index 84f56f927f7..b8922b2cbbe 100644
--- a/apps/twofactor_backupcodes/tests/Unit/Event/CodesGeneratedTest.php
+++ b/apps/twofactor_backupcodes/tests/Unit/Event/CodesGeneratedTest.php
@@ -31,7 +31,6 @@ use OCP\IUser;
use Test\TestCase;
class CodesGeneratedTest extends TestCase {
-
public function testCodeGeneratedEvent() {
$user = $this->createMock(IUser::class);
diff --git a/apps/twofactor_backupcodes/tests/Unit/Listener/ActivityPublisherTest.php b/apps/twofactor_backupcodes/tests/Unit/Listener/ActivityPublisherTest.php
index 2aec2e72d94..a786d5b7f5b 100644
--- a/apps/twofactor_backupcodes/tests/Unit/Listener/ActivityPublisherTest.php
+++ b/apps/twofactor_backupcodes/tests/Unit/Listener/ActivityPublisherTest.php
@@ -96,5 +96,4 @@ class ActivityPublisherTest extends TestCase {
$this->listener->handle($event);
}
-
}
diff --git a/apps/twofactor_backupcodes/tests/Unit/Provider/BackupCodesProviderTest.php b/apps/twofactor_backupcodes/tests/Unit/Provider/BackupCodesProviderTest.php
index 69df82a43fd..1c33cca2cb6 100644
--- a/apps/twofactor_backupcodes/tests/Unit/Provider/BackupCodesProviderTest.php
+++ b/apps/twofactor_backupcodes/tests/Unit/Provider/BackupCodesProviderTest.php
@@ -157,5 +157,4 @@ class BackupCodesProviderTest extends TestCase {
$this->assertTrue($this->provider->isActive($user));
}
-
}
diff --git a/apps/twofactor_backupcodes/tests/Unit/Service/BackupCodeStorageTest.php b/apps/twofactor_backupcodes/tests/Unit/Service/BackupCodeStorageTest.php
index ab895f4d854..20cad61530d 100644
--- a/apps/twofactor_backupcodes/tests/Unit/Service/BackupCodeStorageTest.php
+++ b/apps/twofactor_backupcodes/tests/Unit/Service/BackupCodeStorageTest.php
@@ -235,5 +235,4 @@ class BackupCodeStorageTest extends TestCase {
$this->assertFalse($this->storage->validateCode($user, 'CHALLENGE'));
}
-
}