@@ -1858,7 +1858,7 @@ discard block |
||
| 1858 | 1858 | |
| 1859 | 1859 | public function testGetWithFilter(): void { |
| 1860 | 1860 | $this->config->method('getSystemValueString') |
| 1861 | - ->willReturnCallback(function ($key, $default) { |
|
| 1861 | + ->willReturnCallback(function($key, $default) { |
|
| 1862 | 1862 | if ($key === 'version') { |
| 1863 | 1863 | return '11.0.0.2'; |
| 1864 | 1864 | } elseif ($key === 'appstoreurl' && $default === 'https://apps.nextcloud.com/api/v1') { |
@@ -1942,7 +1942,7 @@ discard block |
||
| 1942 | 1942 | public function testAppstoreDisabled(): void { |
| 1943 | 1943 | $this->config |
| 1944 | 1944 | ->method('getSystemValueString') |
| 1945 | - ->willReturnCallback(function ($var, $default) { |
|
| 1945 | + ->willReturnCallback(function($var, $default) { |
|
| 1946 | 1946 | if ($var === 'version') { |
| 1947 | 1947 | return '11.0.0.2'; |
| 1948 | 1948 | } |
@@ -1950,7 +1950,7 @@ discard block |
||
| 1950 | 1950 | }); |
| 1951 | 1951 | $this->config |
| 1952 | 1952 | ->method('getSystemValueBool') |
| 1953 | - ->willReturnCallback(function ($var, $default) { |
|
| 1953 | + ->willReturnCallback(function($var, $default) { |
|
| 1954 | 1954 | if ($var === 'has_internet_connection') { |
| 1955 | 1955 | return true; |
| 1956 | 1956 | } elseif ($var === 'appstoreenabled') { |
@@ -1969,7 +1969,7 @@ discard block |
||
| 1969 | 1969 | public function testNoInternet(): void { |
| 1970 | 1970 | $this->config |
| 1971 | 1971 | ->method('getSystemValueString') |
| 1972 | - ->willReturnCallback(function ($var, $default) { |
|
| 1972 | + ->willReturnCallback(function($var, $default) { |
|
| 1973 | 1973 | if ($var === 'has_internet_connection') { |
| 1974 | 1974 | return false; |
| 1975 | 1975 | } elseif ($var === 'version') { |
@@ -1979,7 +1979,7 @@ discard block |
||
| 1979 | 1979 | }); |
| 1980 | 1980 | $this->config |
| 1981 | 1981 | ->method('getSystemValueBool') |
| 1982 | - ->willReturnCallback(function ($var, $default) { |
|
| 1982 | + ->willReturnCallback(function($var, $default) { |
|
| 1983 | 1983 | if ($var === 'has_internet_connection') { |
| 1984 | 1984 | return false; |
| 1985 | 1985 | } elseif ($var === 'appstoreenabled') { |
@@ -1996,7 +1996,7 @@ discard block |
||
| 1996 | 1996 | |
| 1997 | 1997 | public function testSetVersion(): void { |
| 1998 | 1998 | $this->config->method('getSystemValueString') |
| 1999 | - ->willReturnCallback(function ($key, $default) { |
|
| 1999 | + ->willReturnCallback(function($key, $default) { |
|
| 2000 | 2000 | if ($key === 'version') { |
| 2001 | 2001 | return '10.0.7.2'; |
| 2002 | 2002 | } elseif ($key === 'appstoreurl' && $default === 'https://apps.nextcloud.com/api/v1') { |
@@ -2080,7 +2080,7 @@ discard block |
||
| 2080 | 2080 | |
| 2081 | 2081 | public function testGetAppsAllowlist(): void { |
| 2082 | 2082 | $this->config->method('getSystemValueString') |
| 2083 | - ->willReturnCallback(function ($key, $default) { |
|
| 2083 | + ->willReturnCallback(function($key, $default) { |
|
| 2084 | 2084 | if ($key === 'version') { |
| 2085 | 2085 | return '11.0.0.2'; |
| 2086 | 2086 | } else { |
@@ -2088,14 +2088,14 @@ discard block |
||
| 2088 | 2088 | } |
| 2089 | 2089 | }); |
| 2090 | 2090 | $this->config->method('getSystemValue') |
| 2091 | - ->willReturnCallback(function ($key, $default) { |
|
| 2091 | + ->willReturnCallback(function($key, $default) { |
|
| 2092 | 2092 | if ($key === 'appsallowlist') { |
| 2093 | 2093 | return ['contacts']; |
| 2094 | 2094 | } |
| 2095 | 2095 | return $default; |
| 2096 | 2096 | }); |
| 2097 | 2097 | $this->config->method('getAppValue') |
| 2098 | - ->willReturnCallback(function ($app, $key, $default) { |
|
| 2098 | + ->willReturnCallback(function($app, $key, $default) { |
|
| 2099 | 2099 | if ($app === 'support' && $key === 'subscription_key') { |
| 2100 | 2100 | return 'subscription-key'; |
| 2101 | 2101 | } |
@@ -2169,7 +2169,7 @@ discard block |
||
| 2169 | 2169 | |
| 2170 | 2170 | public function testGetAppsAllowlistCustomAppstore(): void { |
| 2171 | 2171 | $this->config->method('getSystemValueString') |
| 2172 | - ->willReturnCallback(function ($key, $default) { |
|
| 2172 | + ->willReturnCallback(function($key, $default) { |
|
| 2173 | 2173 | if ($key === 'version') { |
| 2174 | 2174 | return '11.0.0.2'; |
| 2175 | 2175 | } elseif ($key === 'appstoreurl' && $default === 'https://apps.nextcloud.com/api/v1') { |
@@ -2179,7 +2179,7 @@ discard block |
||
| 2179 | 2179 | } |
| 2180 | 2180 | }); |
| 2181 | 2181 | $this->config->method('getSystemValue') |
| 2182 | - ->willReturnCallback(function ($key, $default) { |
|
| 2182 | + ->willReturnCallback(function($key, $default) { |
|
| 2183 | 2183 | if ($key === 'appsallowlist') { |
| 2184 | 2184 | return ['contacts']; |
| 2185 | 2185 | } else { |
@@ -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 | |