diff options
author | Christoph Wurst <christoph@winzerhof-wurst.at> | 2020-04-10 14:19:56 +0200 |
---|---|---|
committer | Christoph Wurst <christoph@winzerhof-wurst.at> | 2020-04-10 14:19:56 +0200 |
commit | caff1023ea72bb2ea94130e18a2a6e2ccf819e5f (patch) | |
tree | 186d494c2aea5dea7255d3584ef5d595fc6e6194 /tests/lib/AppFramework/Utility/ControllerMethodReflectorTest.php | |
parent | edf8ce32cffdb920e8171207b342abbd7f1fbe73 (diff) | |
download | nextcloud-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 'tests/lib/AppFramework/Utility/ControllerMethodReflectorTest.php')
-rw-r--r-- | tests/lib/AppFramework/Utility/ControllerMethodReflectorTest.php | 30 |
1 files changed, 18 insertions, 12 deletions
diff --git a/tests/lib/AppFramework/Utility/ControllerMethodReflectorTest.php b/tests/lib/AppFramework/Utility/ControllerMethodReflectorTest.php index 2d20578efab..990ad44adf3 100644 --- a/tests/lib/AppFramework/Utility/ControllerMethodReflectorTest.php +++ b/tests/lib/AppFramework/Utility/ControllerMethodReflectorTest.php @@ -30,18 +30,20 @@ class BaseController { /** * @Annotation */ - public function test() {} + public function test() { + } /** * @Annotation */ - public function test2() {} + public function test2() { + } /** * @Annotation */ - public function test3() {} - + public function test3() { + } } class MiddleController extends BaseController { @@ -49,13 +51,15 @@ class MiddleController extends BaseController { /** * @NoAnnotation */ - public function test2() {} - - public function test3() {} + public function test2() { + } + public function test3() { + } } -class EndController extends MiddleController {} +class EndController extends MiddleController { +} class ControllerMethodReflectorTest extends \Test\TestCase { @@ -136,7 +140,8 @@ class ControllerMethodReflectorTest extends \Test\TestCase { * @param int $a * @param int $b */ - public function arguments3($a, float $b, int $c, $d) {} + public function arguments3($a, float $b, int $c, $d) { + } /** * @requires PHP 7 @@ -184,7 +189,8 @@ class ControllerMethodReflectorTest extends \Test\TestCase { } - public function arguments($arg, $arg2='hi') {} + public function arguments($arg, $arg2='hi') { + } public function testReflectParameters() { $reader = new ControllerMethodReflector(); $reader->reflect( @@ -196,7 +202,8 @@ class ControllerMethodReflectorTest extends \Test\TestCase { } - public function arguments2($arg) {} + public function arguments2($arg) { + } public function testReflectParameters2() { $reader = new ControllerMethodReflector(); $reader->reflect( @@ -231,5 +238,4 @@ class ControllerMethodReflectorTest extends \Test\TestCase { $this->assertFalse($reader->hasAnnotation('Annotation')); } - } |