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/files/tests/Activity/Filter/GenericTest.php | 1 - apps/files/tests/Activity/Setting/GenericTest.php | 1 - apps/files/tests/BackgroundJob/DeleteOrphanedItemsJobTest.php | 1 - apps/files/tests/BackgroundJob/ScanFilesTest.php | 1 - apps/files/tests/Command/DeleteOrphanedFilesTest.php | 2 +- apps/files/tests/Controller/ApiControllerTest.php | 1 - apps/files/tests/Controller/ViewControllerTest.php | 2 +- apps/files/tests/HelperTest.php | 1 - apps/files/tests/Service/TagServiceTest.php | 6 +++--- 9 files changed, 5 insertions(+), 11 deletions(-) (limited to 'apps/files/tests') diff --git a/apps/files/tests/Activity/Filter/GenericTest.php b/apps/files/tests/Activity/Filter/GenericTest.php index 89169a0e85c..eb55ab2699f 100644 --- a/apps/files/tests/Activity/Filter/GenericTest.php +++ b/apps/files/tests/Activity/Filter/GenericTest.php @@ -36,7 +36,6 @@ use Test\TestCase; * @group DB */ class GenericTest extends TestCase { - public function dataFilters() { return [ [Favorites::class], diff --git a/apps/files/tests/Activity/Setting/GenericTest.php b/apps/files/tests/Activity/Setting/GenericTest.php index 0ebb29d9de3..e741a3e02a8 100644 --- a/apps/files/tests/Activity/Setting/GenericTest.php +++ b/apps/files/tests/Activity/Setting/GenericTest.php @@ -34,7 +34,6 @@ use OCP\Activity\ISetting; use Test\TestCase; class GenericTest extends TestCase { - public function dataSettings() { return [ [FavoriteAction::class], diff --git a/apps/files/tests/BackgroundJob/DeleteOrphanedItemsJobTest.php b/apps/files/tests/BackgroundJob/DeleteOrphanedItemsJobTest.php index b7ef5387090..13ccc678b36 100644 --- a/apps/files/tests/BackgroundJob/DeleteOrphanedItemsJobTest.php +++ b/apps/files/tests/BackgroundJob/DeleteOrphanedItemsJobTest.php @@ -257,5 +257,4 @@ class DeleteOrphanedItemsJobTest extends \Test\TestCase { ->execute(); $this->cleanMapping('comments_read_markers'); } - } diff --git a/apps/files/tests/BackgroundJob/ScanFilesTest.php b/apps/files/tests/BackgroundJob/ScanFilesTest.php index b236f753adb..75557955d6a 100644 --- a/apps/files/tests/BackgroundJob/ScanFilesTest.php +++ b/apps/files/tests/BackgroundJob/ScanFilesTest.php @@ -150,5 +150,4 @@ class ScanFilesTest extends TestCase { $this->invokePrivate($this->scanFiles, 'run', [[]]); } - } diff --git a/apps/files/tests/Command/DeleteOrphanedFilesTest.php b/apps/files/tests/Command/DeleteOrphanedFilesTest.php index 8d6098ff18d..e0a8a72aba3 100644 --- a/apps/files/tests/Command/DeleteOrphanedFilesTest.php +++ b/apps/files/tests/Command/DeleteOrphanedFilesTest.php @@ -72,7 +72,7 @@ class DeleteOrphanedFilesTest extends TestCase { protected function tearDown(): void { $userManager = \OC::$server->getUserManager(); $user1 = $userManager->get($this->user1); - if($user1) { + if ($user1) { $user1->delete(); } diff --git a/apps/files/tests/Controller/ApiControllerTest.php b/apps/files/tests/Controller/ApiControllerTest.php index b35d9d7b95d..d347cffdd81 100644 --- a/apps/files/tests/Controller/ApiControllerTest.php +++ b/apps/files/tests/Controller/ApiControllerTest.php @@ -246,5 +246,4 @@ class ApiControllerTest extends TestCase { $this->assertEquals($expected, $actual); } - } diff --git a/apps/files/tests/Controller/ViewControllerTest.php b/apps/files/tests/Controller/ViewControllerTest.php index c00f30c890a..50eb40079a0 100644 --- a/apps/files/tests/Controller/ViewControllerTest.php +++ b/apps/files/tests/Controller/ViewControllerTest.php @@ -138,7 +138,7 @@ class ViewControllerTest extends TestCase { [$this->user->getUID(), 'files', 'show_grid', true], ]); - $this->config + $this->config ->expects($this->any()) ->method('getAppValue') ->willReturnArgument(2); diff --git a/apps/files/tests/HelperTest.php b/apps/files/tests/HelperTest.php index 6b824e8ead8..867d2dab4b0 100644 --- a/apps/files/tests/HelperTest.php +++ b/apps/files/tests/HelperTest.php @@ -31,7 +31,6 @@ * Class Helper */ class HelperTest extends \Test\TestCase { - private function makeFileInfo($name, $size, $mtime, $isDir = false) { return new \OC\Files\FileInfo( '/' . $name, diff --git a/apps/files/tests/Service/TagServiceTest.php b/apps/files/tests/Service/TagServiceTest.php index 8870c315947..ca6d98909ed 100644 --- a/apps/files/tests/Service/TagServiceTest.php +++ b/apps/files/tests/Service/TagServiceTest.php @@ -111,13 +111,14 @@ class TagServiceTest extends \Test\TestCase { ]) ->setMethods($methods) ->getMock(); - } protected function tearDown(): void { \OC_User::setUserId(''); $user = \OC::$server->getUserManager()->get($this->user); - if ($user !== null) { $user->delete(); } + if ($user !== null) { + $user->delete(); + } } public function testUpdateFileTags() { @@ -162,7 +163,6 @@ class TagServiceTest extends \Test\TestCase { } public function testFavoriteActivity() { - $subdir = $this->root->newFolder('subdir'); $file = $subdir->newFile('test.txt'); -- cgit v1.2.3