@@ -27,7 +27,7 @@ discard block |
||
27 | 27 | public function testAppstoreDisabled(): void { |
28 | 28 | $this->config |
29 | 29 | ->method('getSystemValueBool') |
30 | - ->willReturnCallback(function ($var, $default) { |
|
30 | + ->willReturnCallback(function($var, $default) { |
|
31 | 31 | if ($var === 'appstoreenabled') { |
32 | 32 | return false; |
33 | 33 | } |
@@ -43,7 +43,7 @@ discard block |
||
43 | 43 | public function testNoInternet(): void { |
44 | 44 | $this->config |
45 | 45 | ->method('getSystemValueBool') |
46 | - ->willReturnCallback(function ($var, $default) { |
|
46 | + ->willReturnCallback(function($var, $default) { |
|
47 | 47 | if ($var === 'has_internet_connection') { |
48 | 48 | return false; |
49 | 49 | } |
@@ -51,7 +51,7 @@ discard block |
||
51 | 51 | }); |
52 | 52 | $this->config |
53 | 53 | ->method('getSystemValueString') |
54 | - ->willReturnCallback(function ($var, $default) { |
|
54 | + ->willReturnCallback(function($var, $default) { |
|
55 | 55 | return $default; |
56 | 56 | }); |
57 | 57 | $this->appData |
@@ -14,7 +14,7 @@ discard block |
||
14 | 14 | use PHPUnit\Framework\MockObject\MockObject; |
15 | 15 | |
16 | 16 | class AppDiscoverFetcherTest extends FetcherBase { |
17 | - protected CompareVersion|MockObject $compareVersion; |
|
17 | + protected CompareVersion | MockObject $compareVersion; |
|
18 | 18 | |
19 | 19 | protected function setUp(): void { |
20 | 20 | parent::setUp(); |
@@ -37,7 +37,7 @@ discard block |
||
37 | 37 | public function testAppstoreDisabled(): void { |
38 | 38 | $this->config |
39 | 39 | ->method('getSystemValueBool') |
40 | - ->willReturnCallback(function ($var, $default) { |
|
40 | + ->willReturnCallback(function($var, $default) { |
|
41 | 41 | if ($var === 'appstoreenabled') { |
42 | 42 | return false; |
43 | 43 | } |
@@ -53,7 +53,7 @@ discard block |
||
53 | 53 | public function testNoInternet(): void { |
54 | 54 | $this->config |
55 | 55 | ->method('getSystemValueBool') |
56 | - ->willReturnCallback(function ($var, $default) { |
|
56 | + ->willReturnCallback(function($var, $default) { |
|
57 | 57 | if ($var === 'has_internet_connection') { |
58 | 58 | return false; |
59 | 59 | } |
@@ -61,7 +61,7 @@ discard block |
||
61 | 61 | }); |
62 | 62 | $this->config |
63 | 63 | ->method('getSystemValueString') |
64 | - ->willReturnCallback(function ($var, $default) { |
|
64 | + ->willReturnCallback(function($var, $default) { |
|
65 | 65 | return $default; |
66 | 66 | }); |
67 | 67 | $this->appData |
@@ -62,7 +62,7 @@ discard block |
||
62 | 62 | public function testGetWithAlreadyExistingFileAndUpToDateTimestampAndVersion(): void { |
63 | 63 | $this->config |
64 | 64 | ->method('getSystemValueString') |
65 | - ->willReturnCallback(function ($var, $default) { |
|
65 | + ->willReturnCallback(function($var, $default) { |
|
66 | 66 | if ($var === 'version') { |
67 | 67 | return '11.0.0.2'; |
68 | 68 | } |
@@ -103,7 +103,7 @@ discard block |
||
103 | 103 | public function testGetWithNotExistingFileAndUpToDateTimestampAndVersion(): void { |
104 | 104 | $this->config |
105 | 105 | ->method('getSystemValueString') |
106 | - ->willReturnCallback(function ($var, $default) { |
|
106 | + ->willReturnCallback(function($var, $default) { |
|
107 | 107 | if ($var === 'appstoreurl') { |
108 | 108 | return 'https://apps.nextcloud.com/api/v1'; |
109 | 109 | } elseif ($var === 'version') { |
@@ -177,7 +177,7 @@ discard block |
||
177 | 177 | |
178 | 178 | public function testGetWithAlreadyExistingFileAndOutdatedTimestamp(): void { |
179 | 179 | $this->config->method('getSystemValueString') |
180 | - ->willReturnCallback(function ($key, $default) { |
|
180 | + ->willReturnCallback(function($key, $default) { |
|
181 | 181 | if ($key === 'version') { |
182 | 182 | return '11.0.0.2'; |
183 | 183 | } else { |
@@ -252,7 +252,7 @@ discard block |
||
252 | 252 | public function testGetWithAlreadyExistingFileAndNoVersion(): void { |
253 | 253 | $this->config |
254 | 254 | ->method('getSystemValueString') |
255 | - ->willReturnCallback(function ($var, $default) { |
|
255 | + ->willReturnCallback(function($var, $default) { |
|
256 | 256 | if ($var === 'appstoreurl') { |
257 | 257 | return 'https://apps.nextcloud.com/api/v1'; |
258 | 258 | } elseif ($var === 'version') { |
@@ -325,7 +325,7 @@ discard block |
||
325 | 325 | public function testGetWithAlreadyExistingFileAndOutdatedVersion(): void { |
326 | 326 | $this->config |
327 | 327 | ->method('getSystemValueString') |
328 | - ->willReturnCallback(function ($var, $default) { |
|
328 | + ->willReturnCallback(function($var, $default) { |
|
329 | 329 | if ($var === 'appstoreurl') { |
330 | 330 | return 'https://apps.nextcloud.com/api/v1'; |
331 | 331 | } elseif ($var === 'version') { |
@@ -432,7 +432,7 @@ discard block |
||
432 | 432 | |
433 | 433 | public function testGetMatchingETag(): void { |
434 | 434 | $this->config->method('getSystemValueString') |
435 | - ->willReturnCallback(function ($key, $default) { |
|
435 | + ->willReturnCallback(function($key, $default) { |
|
436 | 436 | if ($key === 'version') { |
437 | 437 | return '11.0.0.2'; |
438 | 438 | } else { |
@@ -511,7 +511,7 @@ discard block |
||
511 | 511 | |
512 | 512 | public function testGetNoMatchingETag(): void { |
513 | 513 | $this->config->method('getSystemValueString') |
514 | - ->willReturnCallback(function ($key, $default) { |
|
514 | + ->willReturnCallback(function($key, $default) { |
|
515 | 515 | if ($key === 'version') { |
516 | 516 | return '11.0.0.2'; |
517 | 517 | } else { |
@@ -596,7 +596,7 @@ discard block |
||
596 | 596 | |
597 | 597 | public function testFetchAfterUpgradeNoETag(): void { |
598 | 598 | $this->config->method('getSystemValueString') |
599 | - ->willReturnCallback(function ($key, $default) { |
|
599 | + ->willReturnCallback(function($key, $default) { |
|
600 | 600 | if ($key === 'version') { |
601 | 601 | return '11.0.0.3'; |
602 | 602 | } else { |
@@ -44,9 +44,9 @@ discard block |
||
44 | 44 | ->willReturn($this->client); |
45 | 45 | $this->client->expects($this->any()) |
46 | 46 | ->method('get') |
47 | - ->willReturnCallback(function ($url) { |
|
47 | + ->willReturnCallback(function($url) { |
|
48 | 48 | if (!isset($this->expectedGetRequests[$url])) { |
49 | - throw new \Exception('unexpected request: ' . $url); |
|
49 | + throw new \Exception('unexpected request: '.$url); |
|
50 | 50 | } |
51 | 51 | $result = $this->expectedGetRequests[$url]; |
52 | 52 | |
@@ -62,9 +62,9 @@ discard block |
||
62 | 62 | }); |
63 | 63 | $this->client->expects($this->any()) |
64 | 64 | ->method('post') |
65 | - ->willReturnCallback(function ($url) { |
|
65 | + ->willReturnCallback(function($url) { |
|
66 | 66 | if (!isset($this->expectedPostRequests[$url])) { |
67 | - throw new \Exception('unexpected request: ' . $url); |
|
67 | + throw new \Exception('unexpected request: '.$url); |
|
68 | 68 | } |
69 | 69 | $result = $this->expectedPostRequests[$url]; |
70 | 70 |
@@ -53,7 +53,7 @@ discard block |
||
53 | 53 | } |
54 | 54 | |
55 | 55 | public function getMimetypes(): array { |
56 | - return [ 'text/plain' ]; |
|
56 | + return ['text/plain']; |
|
57 | 57 | } |
58 | 58 | |
59 | 59 | |
@@ -162,7 +162,7 @@ discard block |
||
162 | 162 | |
163 | 163 | |
164 | 164 | public function testCreateToken(): void { |
165 | - $expectedToken = 'TOKEN' . time(); |
|
165 | + $expectedToken = 'TOKEN'.time(); |
|
166 | 166 | $file = $this->createMock(File::class); |
167 | 167 | $file->expects($this->any()) |
168 | 168 | ->method('getId') |
@@ -187,7 +187,7 @@ discard block |
||
187 | 187 | } |
188 | 188 | |
189 | 189 | public function testCreateTokenAccess(): void { |
190 | - $expectedToken = 'TOKEN' . time(); |
|
190 | + $expectedToken = 'TOKEN'.time(); |
|
191 | 191 | $file = $this->createMock(File::class); |
192 | 192 | $file->expects($this->any()) |
193 | 193 | ->method('getId') |
@@ -215,7 +215,7 @@ discard block |
||
215 | 215 | } |
216 | 216 | |
217 | 217 | public function testOpenByPath(): void { |
218 | - $expectedToken = 'TOKEN' . time(); |
|
218 | + $expectedToken = 'TOKEN'.time(); |
|
219 | 219 | $file = $this->createMock(File::class); |
220 | 220 | $file->expects($this->any()) |
221 | 221 | ->method('getId') |
@@ -246,7 +246,7 @@ discard block |
||
246 | 246 | } |
247 | 247 | |
248 | 248 | public function testOpenById(): void { |
249 | - $expectedToken = 'TOKEN' . time(); |
|
249 | + $expectedToken = 'TOKEN'.time(); |
|
250 | 250 | $fileRead = $this->createMock(File::class); |
251 | 251 | $fileRead->method('getPermissions') |
252 | 252 | ->willReturn(1); |
@@ -49,7 +49,7 @@ |
||
49 | 49 | $avatar = $this->guestAvatar->getFile(32); |
50 | 50 | self::assertInstanceOf(InMemoryFile::class, $avatar); |
51 | 51 | $expectedFile = file_get_contents( |
52 | - __DIR__ . '/../../data/guest_avatar_einstein_32.png' |
|
52 | + __DIR__.'/../../data/guest_avatar_einstein_32.png' |
|
53 | 53 | ); |
54 | 54 | self::assertEquals(trim($expectedFile), trim($avatar->getContent())); |
55 | 55 | } |
@@ -142,7 +142,7 @@ discard block |
||
142 | 142 | 'app2' => [ |
143 | 143 | 'key1' => ['key1', 'value1'], |
144 | 144 | 'key2' => ['key2', 'value2A', ValueType::MIXED, false, 0, true], |
145 | - 'key3' => ['key3', 'value3', ValueType::STRING, true,], |
|
145 | + 'key3' => ['key3', 'value3', ValueType::STRING, true, ], |
|
146 | 146 | 'key4' => ['key4', 'value4', ValueType::STRING, false, UserConfig::FLAG_SENSITIVE], |
147 | 147 | ], |
148 | 148 | 'app3' => [ |
@@ -219,7 +219,7 @@ discard block |
||
219 | 219 | $flags = $row[4] ?? 0; |
220 | 220 | if ((UserConfig::FLAG_SENSITIVE & $flags) !== 0) { |
221 | 221 | $value = self::invokePrivate(UserConfig::class, 'ENCRYPTION_PREFIX') |
222 | - . $this->crypto->encrypt((string)$value); |
|
222 | + . $this->crypto->encrypt((string) $value); |
|
223 | 223 | } else { |
224 | 224 | $indexed = (($row[5] ?? false) === true) ? $value : ''; |
225 | 225 | } |
@@ -774,7 +774,7 @@ discard block |
||
774 | 774 | public function testSearchUsersByValueString( |
775 | 775 | string $app, |
776 | 776 | string $key, |
777 | - string|array $value, |
|
777 | + string | array $value, |
|
778 | 778 | bool $ci, |
779 | 779 | array $result, |
780 | 780 | ): void { |
@@ -41,7 +41,7 @@ |
||
41 | 41 | ->with('core', 'backgroundjobs_mode', $mode); |
42 | 42 | |
43 | 43 | $commandTester = new CommandTester($this->command); |
44 | - $commandTester->execute(['command' => 'background:' . $mode]); |
|
44 | + $commandTester->execute(['command' => 'background:'.$mode]); |
|
45 | 45 | |
46 | 46 | $commandTester->assertCommandIsSuccessful(); |
47 | 47 |
@@ -76,10 +76,10 @@ discard block |
||
76 | 76 | ->method('get') |
77 | 77 | ->with('8b9da631d1f7b022bb2c3c489e16092f82b42fd4') |
78 | 78 | ->willReturn(json_encode([ |
79 | - '1' . '#' . hash('sha1', 'action1') . '#' . hash('sha1', json_encode(['metadata1'])), |
|
80 | - '300' . '#' . hash('sha1', 'action1') . '#' . hash('sha1', json_encode(['metadata2'])), |
|
81 | - '1' . '#' . hash('sha1', 'action2') . '#' . hash('sha1', json_encode(['metadata1'])), |
|
82 | - '300' . '#' . hash('sha1', 'action2') . '#' . hash('sha1', json_encode(['metadata2'])), |
|
79 | + '1'.'#'.hash('sha1', 'action1').'#'.hash('sha1', json_encode(['metadata1'])), |
|
80 | + '300'.'#'.hash('sha1', 'action1').'#'.hash('sha1', json_encode(['metadata2'])), |
|
81 | + '1'.'#'.hash('sha1', 'action2').'#'.hash('sha1', json_encode(['metadata1'])), |
|
82 | + '300'.'#'.hash('sha1', 'action2').'#'.hash('sha1', json_encode(['metadata2'])), |
|
83 | 83 | ])); |
84 | 84 | |
85 | 85 | $this->assertSame($expected, $this->backend->getAttempts('10.10.10.10/32', $maxAge, $action, $metadata)); |
@@ -96,7 +96,7 @@ discard block |
||
96 | 96 | ->method('set') |
97 | 97 | ->with( |
98 | 98 | '8b9da631d1f7b022bb2c3c489e16092f82b42fd4', |
99 | - json_encode(['223#' . hash('sha1', 'action1') . '#' . hash('sha1', json_encode(['metadata1']))]) |
|
99 | + json_encode(['223#'.hash('sha1', 'action1').'#'.hash('sha1', json_encode(['metadata1']))]) |
|
100 | 100 | ); |
101 | 101 | |
102 | 102 | $this->backend->registerAttempt('10.10.10.10', '10.10.10.10/32', 223, 'action1', ['metadata1']); |
@@ -113,12 +113,12 @@ discard block |
||
113 | 113 | ->method('get') |
114 | 114 | ->with('8b9da631d1f7b022bb2c3c489e16092f82b42fd4') |
115 | 115 | ->willReturn(json_encode([ |
116 | - '1#' . hash('sha1', 'action1') . '#' . hash('sha1', json_encode(['metadata1'])), |
|
117 | - '2#' . hash('sha1', 'action2') . '#' . hash('sha1', json_encode(['metadata1'])), |
|
118 | - '87#' . hash('sha1', 'action3') . '#' . hash('sha1', json_encode(['metadata1'])), |
|
119 | - '123#' . hash('sha1', 'action4') . '#' . hash('sha1', json_encode(['metadata1'])), |
|
120 | - '123#' . hash('sha1', 'action5') . '#' . hash('sha1', json_encode(['metadata1'])), |
|
121 | - '124#' . hash('sha1', 'action6') . '#' . hash('sha1', json_encode(['metadata1'])), |
|
116 | + '1#'.hash('sha1', 'action1').'#'.hash('sha1', json_encode(['metadata1'])), |
|
117 | + '2#'.hash('sha1', 'action2').'#'.hash('sha1', json_encode(['metadata1'])), |
|
118 | + '87#'.hash('sha1', 'action3').'#'.hash('sha1', json_encode(['metadata1'])), |
|
119 | + '123#'.hash('sha1', 'action4').'#'.hash('sha1', json_encode(['metadata1'])), |
|
120 | + '123#'.hash('sha1', 'action5').'#'.hash('sha1', json_encode(['metadata1'])), |
|
121 | + '124#'.hash('sha1', 'action6').'#'.hash('sha1', json_encode(['metadata1'])), |
|
122 | 122 | ])); |
123 | 123 | $this->cache |
124 | 124 | ->expects($this->once()) |
@@ -126,11 +126,11 @@ discard block |
||
126 | 126 | ->with( |
127 | 127 | '8b9da631d1f7b022bb2c3c489e16092f82b42fd4', |
128 | 128 | json_encode([ |
129 | - '87#' . hash('sha1', 'action3') . '#' . hash('sha1', json_encode(['metadata1'])), |
|
130 | - '123#' . hash('sha1', 'action4') . '#' . hash('sha1', json_encode(['metadata1'])), |
|
131 | - '123#' . hash('sha1', 'action5') . '#' . hash('sha1', json_encode(['metadata1'])), |
|
132 | - '124#' . hash('sha1', 'action6') . '#' . hash('sha1', json_encode(['metadata1'])), |
|
133 | - '186#' . hash('sha1', 'action7') . '#' . hash('sha1', json_encode(['metadata2'])), |
|
129 | + '87#'.hash('sha1', 'action3').'#'.hash('sha1', json_encode(['metadata1'])), |
|
130 | + '123#'.hash('sha1', 'action4').'#'.hash('sha1', json_encode(['metadata1'])), |
|
131 | + '123#'.hash('sha1', 'action5').'#'.hash('sha1', json_encode(['metadata1'])), |
|
132 | + '124#'.hash('sha1', 'action6').'#'.hash('sha1', json_encode(['metadata1'])), |
|
133 | + '186#'.hash('sha1', 'action7').'#'.hash('sha1', json_encode(['metadata2'])), |
|
134 | 134 | ]) |
135 | 135 | ); |
136 | 136 |