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/user_ldap/tests/Mapping/AbstractMappingTest.php | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) (limited to 'apps/user_ldap/tests/Mapping/AbstractMappingTest.php') diff --git a/apps/user_ldap/tests/Mapping/AbstractMappingTest.php b/apps/user_ldap/tests/Mapping/AbstractMappingTest.php index a298c8b4bce..079c2e21b10 100644 --- a/apps/user_ldap/tests/Mapping/AbstractMappingTest.php +++ b/apps/user_ldap/tests/Mapping/AbstractMappingTest.php @@ -77,7 +77,7 @@ abstract class AbstractMappingTest extends \Test\TestCase { * @param array $data */ protected function mapEntries($mapper, $data) { - foreach($data as $entry) { + foreach ($data as $entry) { $done = $mapper->map($entry['dn'], $entry['name'], $entry['uuid']); $this->assertTrue($done); } @@ -111,9 +111,9 @@ abstract class AbstractMappingTest extends \Test\TestCase { // test that mapping will not happen when it shall not $tooLongDN = 'uid=joann,ou=Secret Small Specialized Department,ou=Some Tremendously Important Department,ou=Another Very Important Department,ou=Pretty Meaningful Derpartment,ou=Quite Broad And General Department,ou=The Topmost Department,dc=hugelysuccessfulcompany,dc=com'; $paramKeys = ['', 'dn', 'name', 'uuid', $tooLongDN]; - foreach($paramKeys as $key) { + foreach ($paramKeys as $key) { $failEntry = $data[0]; - if(!empty($key)) { + if (!empty($key)) { $failEntry[$key] = 'do-not-get-mapped'; } $isMapped = $mapper->map($failEntry['dn'], $failEntry['name'], $failEntry['uuid']); @@ -128,7 +128,7 @@ abstract class AbstractMappingTest extends \Test\TestCase { public function testUnmap() { list($mapper, $data) = $this->initTest(); - foreach($data as $entry) { + foreach ($data as $entry) { $result = $mapper->unmap($entry['name']); $this->assertTrue($result); } @@ -144,21 +144,21 @@ abstract class AbstractMappingTest extends \Test\TestCase { public function testGetMethods() { list($mapper, $data) = $this->initTest(); - foreach($data as $entry) { + foreach ($data as $entry) { $fdn = $mapper->getDNByName($entry['name']); $this->assertSame($fdn, $entry['dn']); } $fdn = $mapper->getDNByName('nosuchname'); $this->assertFalse($fdn); - foreach($data as $entry) { + foreach ($data as $entry) { $name = $mapper->getNameByDN($entry['dn']); $this->assertSame($name, $entry['name']); } $name = $mapper->getNameByDN('nosuchdn'); $this->assertFalse($name); - foreach($data as $entry) { + foreach ($data as $entry) { $name = $mapper->getNameByUUID($entry['uuid']); $this->assertSame($name, $entry['name']); } @@ -229,7 +229,7 @@ abstract class AbstractMappingTest extends \Test\TestCase { $done = $mapper->clear(); $this->assertTrue($done); - foreach($data as $entry) { + foreach ($data as $entry) { $name = $mapper->getNameByUUID($entry['uuid']); $this->assertFalse($name); } @@ -252,7 +252,7 @@ abstract class AbstractMappingTest extends \Test\TestCase { $done = $mapper->clearCb($callback, $callback); $this->assertTrue($done); $this->assertSame(count($data) * 2, $callbackCalls); - foreach($data as $entry) { + foreach ($data as $entry) { $name = $mapper->getNameByUUID($entry['uuid']); $this->assertFalse($name); } -- cgit v1.2.3