From caff1023ea72bb2ea94130e18a2a6e2ccf819e5f Mon Sep 17 00:00:00 2001 From: Christoph Wurst Date: Fri, 10 Apr 2020 14:19:56 +0200 Subject: 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 --- apps/twofactor_backupcodes/tests/Db/BackupCodeMapperTest.php | 1 - apps/twofactor_backupcodes/tests/Service/BackupCodeStorageTest.php | 1 - apps/twofactor_backupcodes/tests/Unit/Activity/ProviderTest.php | 1 - .../tests/Unit/BackgroundJob/CheckBackupCodeTest.php | 2 -- .../tests/Unit/Controller/SettingsControllerTest.php | 1 - apps/twofactor_backupcodes/tests/Unit/Event/CodesGeneratedTest.php | 1 - .../twofactor_backupcodes/tests/Unit/Listener/ActivityPublisherTest.php | 1 - .../tests/Unit/Provider/BackupCodesProviderTest.php | 1 - apps/twofactor_backupcodes/tests/Unit/Service/BackupCodeStorageTest.php | 1 - 9 files changed, 10 deletions(-) (limited to 'apps/twofactor_backupcodes/tests') 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')); } - } -- cgit v1.2.3