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 --- tests/lib/AppFramework/Controller/ApiControllerTest.php | 4 ++-- tests/lib/AppFramework/Controller/ControllerTest.php | 3 --- tests/lib/AppFramework/Controller/OCSControllerTest.php | 3 ++- tests/lib/AppFramework/Controller/PublicShareControllerTest.php | 1 - 4 files changed, 4 insertions(+), 7 deletions(-) (limited to 'tests/lib/AppFramework/Controller') diff --git a/tests/lib/AppFramework/Controller/ApiControllerTest.php b/tests/lib/AppFramework/Controller/ApiControllerTest.php index ccc44b97764..71eb97b94da 100644 --- a/tests/lib/AppFramework/Controller/ApiControllerTest.php +++ b/tests/lib/AppFramework/Controller/ApiControllerTest.php @@ -27,7 +27,8 @@ use OC\AppFramework\Http\Request; use OCP\AppFramework\ApiController; use OCP\IConfig; -class ChildApiController extends ApiController {}; +class ChildApiController extends ApiController { +}; class ApiControllerTest extends \Test\TestCase { @@ -57,5 +58,4 @@ class ApiControllerTest extends \Test\TestCase { $this->assertEquals('false', $headers['Access-Control-Allow-Credentials']); $this->assertEquals(100, $headers['Access-Control-Max-Age']); } - } diff --git a/tests/lib/AppFramework/Controller/ControllerTest.php b/tests/lib/AppFramework/Controller/ControllerTest.php index f15d178df28..e07089e0c82 100644 --- a/tests/lib/AppFramework/Controller/ControllerTest.php +++ b/tests/lib/AppFramework/Controller/ControllerTest.php @@ -30,7 +30,6 @@ use OCP\AppFramework\Http\JSONResponse; use OCP\IConfig; class ChildController extends Controller { - public function __construct($appName, $request) { parent::__construct($appName, $request); $this->registerResponder('tom', function ($respone) { @@ -157,6 +156,4 @@ class ControllerTest extends \Test\TestCase { $this->assertEquals('tom', $responder); } - - } diff --git a/tests/lib/AppFramework/Controller/OCSControllerTest.php b/tests/lib/AppFramework/Controller/OCSControllerTest.php index 85f2a7f6463..91a61047871 100644 --- a/tests/lib/AppFramework/Controller/OCSControllerTest.php +++ b/tests/lib/AppFramework/Controller/OCSControllerTest.php @@ -30,7 +30,8 @@ use OCP\AppFramework\OCSController; use OCP\IConfig; use OCP\Security\ISecureRandom; -class ChildOCSController extends OCSController {} +class ChildOCSController extends OCSController { +} class OCSControllerTest extends \Test\TestCase { diff --git a/tests/lib/AppFramework/Controller/PublicShareControllerTest.php b/tests/lib/AppFramework/Controller/PublicShareControllerTest.php index 388d5fbeef2..521c45e47c6 100644 --- a/tests/lib/AppFramework/Controller/PublicShareControllerTest.php +++ b/tests/lib/AppFramework/Controller/PublicShareControllerTest.php @@ -89,5 +89,4 @@ class PublicShareControllerTest extends \Test\TestCase { $this->assertEquals($expected, $this->controller->isAuthenticated()); } - } -- cgit v1.2.3