@@ -51,7 +51,7 @@ |
||
| 51 | 51 | $entry = $this->createMock(Entry::class); |
| 52 | 52 | $entry->expects($this->any()) |
| 53 | 53 | ->method('getFullName') |
| 54 | - ->willReturn('Contact ' . $char); |
|
| 54 | + ->willReturn('Contact '.$char); |
|
| 55 | 55 | $entries[] = $entry; |
| 56 | 56 | } |
| 57 | 57 | return $entries; |
@@ -123,9 +123,9 @@ |
||
| 123 | 123 | |
| 124 | 124 | if (substr_count($string, '.')) { |
| 125 | 125 | [$alias, $columnName] = explode('.', $string); |
| 126 | - return '`' . $alias . '`.`' . $columnName . '`'; |
|
| 126 | + return '`'.$alias.'`.`'.$columnName.'`'; |
|
| 127 | 127 | } |
| 128 | 128 | |
| 129 | - return '`' . $string . '`'; |
|
| 129 | + return '`'.$string.'`'; |
|
| 130 | 130 | } |
| 131 | 131 | } |
@@ -64,18 +64,18 @@ discard block |
||
| 64 | 64 | } |
| 65 | 65 | |
| 66 | 66 | private function getUniqueTableName() { |
| 67 | - return strtolower($this->getUniqueID($this->config->getSystemValueString('dbtableprefix', 'oc_') . 'test_')); |
|
| 67 | + return strtolower($this->getUniqueID($this->config->getSystemValueString('dbtableprefix', 'oc_').'test_')); |
|
| 68 | 68 | } |
| 69 | 69 | |
| 70 | 70 | protected function tearDown(): void { |
| 71 | 71 | // Try to delete if exists (IF EXISTS NOT SUPPORTED IN ORACLE) |
| 72 | 72 | try { |
| 73 | - $this->connection->exec('DROP TABLE ' . $this->connection->quoteIdentifier($this->tableNameTmp)); |
|
| 73 | + $this->connection->exec('DROP TABLE '.$this->connection->quoteIdentifier($this->tableNameTmp)); |
|
| 74 | 74 | } catch (Exception $e) { |
| 75 | 75 | } |
| 76 | 76 | |
| 77 | 77 | try { |
| 78 | - $this->connection->exec('DROP TABLE ' . $this->connection->quoteIdentifier($this->tableName)); |
|
| 78 | + $this->connection->exec('DROP TABLE '.$this->connection->quoteIdentifier($this->tableName)); |
|
| 79 | 79 | } catch (Exception $e) { |
| 80 | 80 | } |
| 81 | 81 | parent::tearDown(); |
@@ -89,13 +89,13 @@ discard block |
||
| 89 | 89 | $table = $startSchema->createTable($this->tableName); |
| 90 | 90 | $table->addColumn('id', 'integer'); |
| 91 | 91 | $table->addColumn('name', 'string'); |
| 92 | - $table->addIndex(['id'], $this->tableName . '_id'); |
|
| 92 | + $table->addIndex(['id'], $this->tableName.'_id'); |
|
| 93 | 93 | |
| 94 | 94 | $endSchema = new Schema([], [], $this->getSchemaConfig()); |
| 95 | 95 | $table = $endSchema->createTable($this->tableName); |
| 96 | 96 | $table->addColumn('id', 'integer'); |
| 97 | 97 | $table->addColumn('name', 'string'); |
| 98 | - $table->addUniqueIndex(['id'], $this->tableName . '_id'); |
|
| 98 | + $table->addUniqueIndex(['id'], $this->tableName.'_id'); |
|
| 99 | 99 | |
| 100 | 100 | return [$startSchema, $endSchema]; |
| 101 | 101 | } |
@@ -108,13 +108,13 @@ discard block |
||
| 108 | 108 | $table = $startSchema->createTable($this->tableName); |
| 109 | 109 | $table->addColumn('id', $from); |
| 110 | 110 | $table->addColumn('name', 'string'); |
| 111 | - $table->addIndex(['id'], $this->tableName . '_id'); |
|
| 111 | + $table->addIndex(['id'], $this->tableName.'_id'); |
|
| 112 | 112 | |
| 113 | 113 | $endSchema = new Schema([], [], $this->getSchemaConfig()); |
| 114 | 114 | $table = $endSchema->createTable($this->tableName); |
| 115 | 115 | $table->addColumn('id', $to); |
| 116 | 116 | $table->addColumn('name', 'string'); |
| 117 | - $table->addIndex(['id'], $this->tableName . '_id'); |
|
| 117 | + $table->addIndex(['id'], $this->tableName.'_id'); |
|
| 118 | 118 | |
| 119 | 119 | return [$startSchema, $endSchema]; |
| 120 | 120 | } |
@@ -143,7 +143,7 @@ discard block |
||
| 143 | 143 | $oldTablePrefix = $this->config->getSystemValueString('dbtableprefix', 'oc_'); |
| 144 | 144 | |
| 145 | 145 | $this->config->setSystemValue('dbtableprefix', 'ownc_'); |
| 146 | - $this->tableName = strtolower($this->getUniqueID($this->config->getSystemValueString('dbtableprefix') . 'test_')); |
|
| 146 | + $this->tableName = strtolower($this->getUniqueID($this->config->getSystemValueString('dbtableprefix').'test_')); |
|
| 147 | 147 | |
| 148 | 148 | [$startSchema, $endSchema] = $this->getDuplicateKeySchemas(); |
| 149 | 149 | $migrator = $this->getMigrator(); |
@@ -291,7 +291,7 @@ discard block |
||
| 291 | 291 | $table->addColumn('will_it_blend', $columnType, [ |
| 292 | 292 | 'notnull' => true, |
| 293 | 293 | ]); |
| 294 | - $table->addIndex(['id'], $this->tableName . '_id'); |
|
| 294 | + $table->addIndex(['id'], $this->tableName.'_id'); |
|
| 295 | 295 | |
| 296 | 296 | $migrator = $this->getMigrator(); |
| 297 | 297 | $migrator->migrate($startSchema); |
@@ -90,7 +90,7 @@ |
||
| 90 | 90 | } |
| 91 | 91 | |
| 92 | 92 | $v = new Validator(new Definitions()); |
| 93 | - $v->validate('{' . $key . '}', [ |
|
| 93 | + $v->validate('{'.$key.'}', [ |
|
| 94 | 94 | $key => [ |
| 95 | 95 | 'type' => 'highlight', |
| 96 | 96 | 'id' => 'identifier', |
@@ -58,18 +58,18 @@ |
||
| 58 | 58 | } |
| 59 | 59 | |
| 60 | 60 | public function validateParameter($parameter, $data) { |
| 61 | - $this->assertTrue(is_array($data), 'Parameter ' . $parameter . ' is invalid'); |
|
| 61 | + $this->assertTrue(is_array($data), 'Parameter '.$parameter.' is invalid'); |
|
| 62 | 62 | $this->assertArrayHasKey('since', $data); |
| 63 | - $this->assertNotEmpty($data['since'], 'Since of parameter ' . $parameter . ' must not be empty'); |
|
| 63 | + $this->assertNotEmpty($data['since'], 'Since of parameter '.$parameter.' must not be empty'); |
|
| 64 | 64 | $this->assertArrayHasKey('required', $data); |
| 65 | - $this->assertTrue(is_bool($data['required']), 'Required of parameter ' . $parameter . ' must be a boolean'); |
|
| 65 | + $this->assertTrue(is_bool($data['required']), 'Required of parameter '.$parameter.' must be a boolean'); |
|
| 66 | 66 | if ($parameter === 'id' || $parameter === 'name') { |
| 67 | - $this->assertTrue($data['required'], 'Parameter ' . $parameter . ' must be required'); |
|
| 67 | + $this->assertTrue($data['required'], 'Parameter '.$parameter.' must be required'); |
|
| 68 | 68 | } |
| 69 | 69 | |
| 70 | 70 | $this->assertArrayHasKey('description', $data); |
| 71 | - $this->assertNotEquals('', $data['description'], 'Description of parameter ' . $parameter . ' must not be empty'); |
|
| 71 | + $this->assertNotEquals('', $data['description'], 'Description of parameter '.$parameter.' must not be empty'); |
|
| 72 | 72 | $this->assertArrayHasKey('example', $data); |
| 73 | - $this->assertNotEquals('', $data['example'], 'Example of parameter ' . $parameter . ' must not be empty'); |
|
| 73 | + $this->assertNotEquals('', $data['example'], 'Example of parameter '.$parameter.' must not be empty'); |
|
| 74 | 74 | } |
| 75 | 75 | } |
@@ -52,7 +52,7 @@ discard block |
||
| 52 | 52 | $this->userSession->expects($this->any())->method('getUser') |
| 53 | 53 | ->willReturn($user); |
| 54 | 54 | $this->cloudIdManager->expects($this->any())->method('resolveCloudId') |
| 55 | - ->willReturnCallback(function ($cloudId) { |
|
| 55 | + ->willReturnCallback(function($cloudId) { |
|
| 56 | 56 | if ($cloudId === '[email protected]') { |
| 57 | 57 | return new CloudId('[email protected]', 'user', 'myNextcloud.net'); |
| 58 | 58 | } |
@@ -162,8 +162,8 @@ discard block |
||
| 162 | 162 | $client = $this->createMock(IClient::class); |
| 163 | 163 | $client->expects($this->once()) |
| 164 | 164 | ->method('get') |
| 165 | - ->willReturnCallback(function ($url) use ($searchParams, $response) { |
|
| 166 | - $this->assertSame(strpos($url, $searchParams['server'] . '/users?search='), 0); |
|
| 165 | + ->willReturnCallback(function($url) use ($searchParams, $response) { |
|
| 166 | + $this->assertSame(strpos($url, $searchParams['server'].'/users?search='), 0); |
|
| 167 | 167 | $this->assertNotFalse(strpos($url, urlencode($searchParams['search']))); |
| 168 | 168 | return $response; |
| 169 | 169 | }); |
@@ -226,8 +226,8 @@ discard block |
||
| 226 | 226 | $client = $this->createMock(IClient::class); |
| 227 | 227 | $client->expects($this->once()) |
| 228 | 228 | ->method('get') |
| 229 | - ->willReturnCallback(function ($url) use ($searchParams, $response) { |
|
| 230 | - $this->assertSame(strpos($url, $searchParams['server'] . '/users?search='), 0); |
|
| 229 | + ->willReturnCallback(function($url) use ($searchParams, $response) { |
|
| 230 | + $this->assertSame(strpos($url, $searchParams['server'].'/users?search='), 0); |
|
| 231 | 231 | $this->assertNotFalse(strpos($url, urlencode($searchParams['search']))); |
| 232 | 232 | return $response; |
| 233 | 233 | }); |
@@ -323,7 +323,7 @@ discard block |
||
| 323 | 323 | 'extra' => ['federationId' => $fedIDs[2]], |
| 324 | 324 | ], |
| 325 | 325 | ] |
| 326 | - ],// GS , Lookup |
|
| 326 | + ], // GS , Lookup |
|
| 327 | 327 | true, true |
| 328 | 328 | ], |
| 329 | 329 | [[ |
@@ -365,7 +365,7 @@ discard block |
||
| 365 | 365 | 'extra' => ['federationId' => $fedIDs[2]], |
| 366 | 366 | ], |
| 367 | 367 | ] |
| 368 | - ],// GS , Lookup |
|
| 368 | + ], // GS , Lookup |
|
| 369 | 369 | true, false |
| 370 | 370 | ], |
| 371 | 371 | [[ |
@@ -404,7 +404,7 @@ discard block |
||
| 404 | 404 | 'extra' => ['federationId' => $fedIDs[2]], |
| 405 | 405 | ], |
| 406 | 406 | ] |
| 407 | - ],// GS , Lookup |
|
| 407 | + ], // GS , Lookup |
|
| 408 | 408 | false, true |
| 409 | 409 | ], |
| 410 | 410 | [[ |
@@ -443,7 +443,7 @@ discard block |
||
| 443 | 443 | 'extra' => ['federationId' => $fedIDs[2]], |
| 444 | 444 | ], |
| 445 | 445 | ] |
| 446 | - ],// GS , Lookup |
|
| 446 | + ], // GS , Lookup |
|
| 447 | 447 | false, false |
| 448 | 448 | ], |
| 449 | 449 | ]; |
@@ -49,7 +49,7 @@ discard block |
||
| 49 | 49 | $userPlugin = $this->createMock(ISearchPlugin::class); |
| 50 | 50 | $userPlugin->expects($this->any()) |
| 51 | 51 | ->method('search') |
| 52 | - ->willReturnCallback(function () use ($searchResult, $mockedUserResult, $expectedMoreResults) { |
|
| 52 | + ->willReturnCallback(function() use ($searchResult, $mockedUserResult, $expectedMoreResults) { |
|
| 53 | 53 | $type = new SearchResultType('users'); |
| 54 | 54 | $searchResult->addResultSet($type, $mockedUserResult); |
| 55 | 55 | return $expectedMoreResults; |
@@ -58,7 +58,7 @@ discard block |
||
| 58 | 58 | $groupPlugin = $this->createMock(ISearchPlugin::class); |
| 59 | 59 | $groupPlugin->expects($this->any()) |
| 60 | 60 | ->method('search') |
| 61 | - ->willReturnCallback(function () use ($searchResult, $mockedGroupsResult, $expectedMoreResults) { |
|
| 61 | + ->willReturnCallback(function() use ($searchResult, $mockedGroupsResult, $expectedMoreResults) { |
|
| 62 | 62 | $type = new SearchResultType('groups'); |
| 63 | 63 | $searchResult->addResultSet($type, $mockedGroupsResult); |
| 64 | 64 | return $expectedMoreResults; |
@@ -67,7 +67,7 @@ discard block |
||
| 67 | 67 | $remotePlugin = $this->createMock(ISearchPlugin::class); |
| 68 | 68 | $remotePlugin->expects($this->any()) |
| 69 | 69 | ->method('search') |
| 70 | - ->willReturnCallback(function () use ($searchResult, $mockedRemotesResult, $expectedMoreResults) { |
|
| 70 | + ->willReturnCallback(function() use ($searchResult, $mockedRemotesResult, $expectedMoreResults) { |
|
| 71 | 71 | if ($mockedRemotesResult !== null) { |
| 72 | 72 | $type = new SearchResultType('remotes'); |
| 73 | 73 | $searchResult->addResultSet($type, $mockedRemotesResult['results'], $mockedRemotesResult['exact']); |
@@ -81,7 +81,7 @@ discard block |
||
| 81 | 81 | $mailPlugin = $this->createMock(ISearchPlugin::class); |
| 82 | 82 | $mailPlugin->expects($this->any()) |
| 83 | 83 | ->method('search') |
| 84 | - ->willReturnCallback(function () use ($searchResult, $mockedMailResult, $expectedMoreResults) { |
|
| 84 | + ->willReturnCallback(function() use ($searchResult, $mockedMailResult, $expectedMoreResults) { |
|
| 85 | 85 | $type = new SearchResultType('emails'); |
| 86 | 86 | $searchResult->addResultSet($type, $mockedMailResult); |
| 87 | 87 | return $expectedMoreResults; |
@@ -89,7 +89,7 @@ discard block |
||
| 89 | 89 | |
| 90 | 90 | $this->container->expects($this->any()) |
| 91 | 91 | ->method('resolve') |
| 92 | - ->willReturnCallback(function ($class) use ($searchResult, $userPlugin, $groupPlugin, $remotePlugin, $mailPlugin) { |
|
| 92 | + ->willReturnCallback(function($class) use ($searchResult, $userPlugin, $groupPlugin, $remotePlugin, $mailPlugin) { |
|
| 93 | 93 | if ($class === SearchResult::class) { |
| 94 | 94 | return $searchResult; |
| 95 | 95 | } elseif ($class === $userPlugin) { |
@@ -214,24 +214,24 @@ discard block |
||
| 214 | 214 | [IShare::TYPE_USER, IShare::TYPE_GROUP, IShare::TYPE_REMOTE, IShare::TYPE_EMAIL], // plugins |
| 215 | 215 | 1, // page |
| 216 | 216 | 10, // per page |
| 217 | - [ // user result |
|
| 217 | + [// user result |
|
| 218 | 218 | ['label' => 'test One', 'value' => ['shareType' => IShare::TYPE_USER, 'shareWith' => 'test1']], |
| 219 | 219 | ], |
| 220 | - [ // group result |
|
| 220 | + [// group result |
|
| 221 | 221 | ['label' => 'testgroup1', 'value' => ['shareType' => IShare::TYPE_GROUP, 'shareWith' => 'testgroup1']], |
| 222 | 222 | ], |
| 223 | - [ // remote result |
|
| 223 | + [// remote result |
|
| 224 | 224 | 'results' => [ |
| 225 | - ['label' => '[email protected]', 'uuid' => 'f3d78140-abcc-46df-b58d-c7cc1176aadf','value' => ['shareType' => IShare::TYPE_REMOTE, 'shareWith' => '[email protected]']] |
|
| 225 | + ['label' => '[email protected]', 'uuid' => 'f3d78140-abcc-46df-b58d-c7cc1176aadf', 'value' => ['shareType' => IShare::TYPE_REMOTE, 'shareWith' => '[email protected]']] |
|
| 226 | 226 | ], |
| 227 | 227 | 'exact' => [], |
| 228 | 228 | 'exactIdMatch' => false, |
| 229 | 229 | ], |
| 230 | - [ // mail result |
|
| 230 | + [// mail result |
|
| 231 | 231 | ['label' => 'test Two', 'uuid' => 'b2321e9e-31af-43ac-a406-583fb26d1964', 'value' => ['shareType' => IShare::TYPE_EMAIL, 'shareWith' => '[email protected]']], |
| 232 | 232 | ['label' => 'test One', 'uuid' => 'f3d78140-abcc-46df-b58d-c7cc1176aadf', 'value' => ['shareType' => IShare::TYPE_EMAIL, 'shareWith' => '[email protected]']], |
| 233 | 233 | ], |
| 234 | - [ // expected result |
|
| 234 | + [// expected result |
|
| 235 | 235 | 'exact' => ['users' => [], 'groups' => [], 'remotes' => [], 'emails' => []], |
| 236 | 236 | 'users' => [ |
| 237 | 237 | ['label' => 'test One', 'value' => ['shareType' => IShare::TYPE_USER, 'shareWith' => 'test1']], |
@@ -24,12 +24,12 @@ |
||
| 24 | 24 | $this->crypto = $this->createMock(ICrypto::class); |
| 25 | 25 | $this->crypto->expects($this->any()) |
| 26 | 26 | ->method('encrypt') |
| 27 | - ->willReturnCallback(function ($input) { |
|
| 28 | - return '#' . $input . '#'; |
|
| 27 | + ->willReturnCallback(function($input) { |
|
| 28 | + return '#'.$input.'#'; |
|
| 29 | 29 | }); |
| 30 | 30 | $this->crypto->expects($this->any()) |
| 31 | 31 | ->method('decrypt') |
| 32 | - ->willReturnCallback(function ($input) { |
|
| 32 | + ->willReturnCallback(function($input) { |
|
| 33 | 33 | if ($input === '') { |
| 34 | 34 | return ''; |
| 35 | 35 | } |
@@ -32,12 +32,12 @@ discard block |
||
| 32 | 32 | ->getMock(); |
| 33 | 33 | $this->crypto->expects($this->any()) |
| 34 | 34 | ->method('encrypt') |
| 35 | - ->willReturnCallback(function ($input) { |
|
| 35 | + ->willReturnCallback(function($input) { |
|
| 36 | 36 | return $input; |
| 37 | 37 | }); |
| 38 | 38 | $this->crypto->expects($this->any()) |
| 39 | 39 | ->method('decrypt') |
| 40 | - ->willReturnCallback(function ($input) { |
|
| 40 | + ->willReturnCallback(function($input) { |
|
| 41 | 41 | if ($input === '') { |
| 42 | 42 | return ''; |
| 43 | 43 | } |
@@ -54,7 +54,7 @@ discard block |
||
| 54 | 54 | $this->wrappedSession->expects($this->once()) |
| 55 | 55 | ->method('get') |
| 56 | 56 | ->with('encrypted_session_data') |
| 57 | - ->willReturnCallback(function () use ($encryptedValue) { |
|
| 57 | + ->willReturnCallback(function() use ($encryptedValue) { |
|
| 58 | 58 | return $encryptedValue; |
| 59 | 59 | }); |
| 60 | 60 | |