@@ -27,11 +27,11 @@ |
||
| 27 | 27 | protected function setupUser($name, $password): View { |
| 28 | 28 | $this->createUser($name, $password); |
| 29 | 29 | $tmpFolder = Server::get(ITempManager::class)->getTemporaryFolder(); |
| 30 | - $this->registerMount($name, '\OC\Files\Storage\Local', '/' . $name, ['datadir' => $tmpFolder]); |
|
| 30 | + $this->registerMount($name, '\OC\Files\Storage\Local', '/'.$name, ['datadir' => $tmpFolder]); |
|
| 31 | 31 | // we use per-user keys |
| 32 | 32 | Server::get(IConfig::class)->setAppValue('encryption', 'useMasterKey', '0'); |
| 33 | 33 | $this->setupForUser($name, $password); |
| 34 | 34 | $this->loginWithEncryption($name); |
| 35 | - return new View('/' . $name . '/files'); |
|
| 35 | + return new View('/'.$name.'/files'); |
|
| 36 | 36 | } |
| 37 | 37 | } |
@@ -27,11 +27,11 @@ |
||
| 27 | 27 | protected function setupUser($name, $password): View { |
| 28 | 28 | $this->createUser($name, $password); |
| 29 | 29 | $tmpFolder = Server::get(ITempManager::class)->getTemporaryFolder(); |
| 30 | - $this->registerMount($name, '\OC\Files\Storage\Local', '/' . $name, ['datadir' => $tmpFolder]); |
|
| 30 | + $this->registerMount($name, '\OC\Files\Storage\Local', '/'.$name, ['datadir' => $tmpFolder]); |
|
| 31 | 31 | // we use the master key |
| 32 | 32 | Server::get(IConfig::class)->setAppValue('encryption', 'useMasterKey', '1'); |
| 33 | 33 | $this->setupForUser($name, $password); |
| 34 | 34 | $this->loginWithEncryption($name); |
| 35 | - return new View('/' . $name . '/files'); |
|
| 35 | + return new View('/'.$name.'/files'); |
|
| 36 | 36 | } |
| 37 | 37 | } |
@@ -60,9 +60,9 @@ discard block |
||
| 60 | 60 | protected function setupUser($name, $password): View { |
| 61 | 61 | $this->createUser($name, $password); |
| 62 | 62 | $tmpFolder = \OCP\Server::get(ITempManager::class)->getTemporaryFolder(); |
| 63 | - $this->registerMount($name, '\OC\Files\Storage\Local', '/' . $name, ['datadir' => $tmpFolder]); |
|
| 63 | + $this->registerMount($name, '\OC\Files\Storage\Local', '/'.$name, ['datadir' => $tmpFolder]); |
|
| 64 | 64 | self::loginAsUser($name); |
| 65 | - return new View('/' . $name . '/files'); |
|
| 65 | + return new View('/'.$name.'/files'); |
|
| 66 | 66 | } |
| 67 | 67 | |
| 68 | 68 | /** |
@@ -90,7 +90,7 @@ discard block |
||
| 90 | 90 | $serverParams = []; |
| 91 | 91 | if (is_array($headers)) { |
| 92 | 92 | foreach ($headers as $header => $value) { |
| 93 | - $serverParams['HTTP_' . strtoupper(str_replace('-', '_', $header))] = $value; |
|
| 93 | + $serverParams['HTTP_'.strtoupper(str_replace('-', '_', $header))] = $value; |
|
| 94 | 94 | } |
| 95 | 95 | } |
| 96 | 96 | $ncRequest = new \OC\AppFramework\Http\Request([ |
@@ -133,7 +133,7 @@ discard block |
||
| 133 | 133 | $authBackend = new Auth($user, $password); |
| 134 | 134 | $authPlugin = new \Sabre\DAV\Auth\Plugin($authBackend); |
| 135 | 135 | |
| 136 | - $server = $this->serverFactory->createServer(false, '/', 'dummy', $authPlugin, function () use ($view) { |
|
| 136 | + $server = $this->serverFactory->createServer(false, '/', 'dummy', $authPlugin, function() use ($view) { |
|
| 137 | 137 | return $view; |
| 138 | 138 | }); |
| 139 | 139 | $server->addPlugin($exceptionPlugin); |
@@ -24,7 +24,7 @@ |
||
| 24 | 24 | $mockConfig = $this->createMock(IConfig::class); |
| 25 | 25 | $mockConfig->expects($this->any()) |
| 26 | 26 | ->method('getSystemValue') |
| 27 | - ->willReturnCallback(function ($key, $default) use ($config) { |
|
| 27 | + ->willReturnCallback(function($key, $default) use ($config) { |
|
| 28 | 28 | if ($key === 'part_file_in_storage') { |
| 29 | 29 | return false; |
| 30 | 30 | } else { |
@@ -19,7 +19,7 @@ |
||
| 19 | 19 | private QuotaPlugin $plugin; |
| 20 | 20 | |
| 21 | 21 | private function init(int $quota, string $checkedPath = ''): void { |
| 22 | - $view = $this->buildFileViewMock((string)$quota, $checkedPath); |
|
| 22 | + $view = $this->buildFileViewMock((string) $quota, $checkedPath); |
|
| 23 | 23 | $this->server = new \Sabre\DAV\Server(); |
| 24 | 24 | $this->plugin = new QuotaPlugin($view); |
| 25 | 25 | $this->plugin->initialize($this->server); |
@@ -159,7 +159,7 @@ discard block |
||
| 159 | 159 | ->onlyMethods(['writeStream']) |
| 160 | 160 | ->setConstructorArgs([['datadir' => Server::get(ITempManager::class)->getTemporaryFolder()]]) |
| 161 | 161 | ->getMock(); |
| 162 | - Filesystem::mount($storage, [], $this->user . '/'); |
|
| 162 | + Filesystem::mount($storage, [], $this->user.'/'); |
|
| 163 | 163 | /** @var View&MockObject $view */ |
| 164 | 164 | $view = $this->getMockBuilder(View::class) |
| 165 | 165 | ->onlyMethods(['getRelativePath', 'resolvePath']) |
@@ -167,7 +167,7 @@ discard block |
||
| 167 | 167 | $view->expects($this->atLeastOnce()) |
| 168 | 168 | ->method('resolvePath') |
| 169 | 169 | ->willReturnCallback( |
| 170 | - function ($path) use ($storage) { |
|
| 170 | + function($path) use ($storage) { |
|
| 171 | 171 | return [$storage, $path]; |
| 172 | 172 | } |
| 173 | 173 | ); |
@@ -223,11 +223,11 @@ discard block |
||
| 223 | 223 | if (!is_null($viewRoot)) { |
| 224 | 224 | $view = new View($viewRoot); |
| 225 | 225 | } else { |
| 226 | - $viewRoot = '/' . $this->user . '/files'; |
|
| 226 | + $viewRoot = '/'.$this->user.'/files'; |
|
| 227 | 227 | } |
| 228 | 228 | |
| 229 | 229 | $info = new \OC\Files\FileInfo( |
| 230 | - $viewRoot . '/' . ltrim($path, '/'), |
|
| 230 | + $viewRoot.'/'.ltrim($path, '/'), |
|
| 231 | 231 | $this->getMockStorage(), |
| 232 | 232 | null, |
| 233 | 233 | [ |
@@ -321,7 +321,7 @@ discard block |
||
| 321 | 321 | public function testPutSingleFileLegalMtime(mixed $requestMtime, ?int $resultMtime): void { |
| 322 | 322 | $request = new Request([ |
| 323 | 323 | 'server' => [ |
| 324 | - 'HTTP_X_OC_MTIME' => (string)$requestMtime, |
|
| 324 | + 'HTTP_X_OC_MTIME' => (string) $requestMtime, |
|
| 325 | 325 | ] |
| 326 | 326 | ], $this->requestId, $this->config, null); |
| 327 | 327 | $file = 'foo.txt'; |
@@ -414,7 +414,7 @@ discard block |
||
| 414 | 414 | HookHelper::setUpHooks(); |
| 415 | 415 | |
| 416 | 416 | // happens with public webdav where the view root is the share root |
| 417 | - $this->assertNotEmpty($this->doPut('/foo.txt', '/' . $this->user . '/files/noderoot')); |
|
| 417 | + $this->assertNotEmpty($this->doPut('/foo.txt', '/'.$this->user.'/files/noderoot')); |
|
| 418 | 418 | |
| 419 | 419 | $this->assertCount(4, HookHelper::$hookCalls); |
| 420 | 420 | $this->assertHookCall( |
@@ -526,12 +526,12 @@ discard block |
||
| 526 | 526 | * Test exception during final rename in simple upload mode |
| 527 | 527 | */ |
| 528 | 528 | public function testSimplePutFailsMoveFromStorage(): void { |
| 529 | - $view = new View('/' . $this->user . '/files'); |
|
| 529 | + $view = new View('/'.$this->user.'/files'); |
|
| 530 | 530 | |
| 531 | 531 | // simulate situation where the target file is locked |
| 532 | 532 | $view->lockFile('/test.txt', ILockingProvider::LOCK_EXCLUSIVE); |
| 533 | 533 | |
| 534 | - $info = new \OC\Files\FileInfo('/' . $this->user . '/files/test.txt', $this->getMockStorage(), null, [ |
|
| 534 | + $info = new \OC\Files\FileInfo('/'.$this->user.'/files/test.txt', $this->getMockStorage(), null, [ |
|
| 535 | 535 | 'permissions' => Constants::PERMISSION_ALL, |
| 536 | 536 | 'type' => FileInfo::TYPE_FOLDER, |
| 537 | 537 | ], null); |
@@ -781,11 +781,11 @@ discard block |
||
| 781 | 781 | * Test whether locks are set before and after the operation |
| 782 | 782 | */ |
| 783 | 783 | public function testPutLocking(): void { |
| 784 | - $view = new View('/' . $this->user . '/files/'); |
|
| 784 | + $view = new View('/'.$this->user.'/files/'); |
|
| 785 | 785 | |
| 786 | 786 | $path = 'test-locking.txt'; |
| 787 | 787 | $info = new \OC\Files\FileInfo( |
| 788 | - '/' . $this->user . '/files/' . $path, |
|
| 788 | + '/'.$this->user.'/files/'.$path, |
|
| 789 | 789 | $this->getMockStorage(), |
| 790 | 790 | null, |
| 791 | 791 | [ |
@@ -817,7 +817,7 @@ discard block |
||
| 817 | 817 | $eventHandler->expects($this->once()) |
| 818 | 818 | ->method('writeCallback') |
| 819 | 819 | ->willReturnCallback( |
| 820 | - function () use ($view, $path, &$wasLockedPre): void { |
|
| 820 | + function() use ($view, $path, &$wasLockedPre): void { |
|
| 821 | 821 | $wasLockedPre = $this->isFileLocked($view, $path, ILockingProvider::LOCK_SHARED); |
| 822 | 822 | $wasLockedPre = $wasLockedPre && !$this->isFileLocked($view, $path, ILockingProvider::LOCK_EXCLUSIVE); |
| 823 | 823 | } |
@@ -825,7 +825,7 @@ discard block |
||
| 825 | 825 | $eventHandler->expects($this->once()) |
| 826 | 826 | ->method('postWriteCallback') |
| 827 | 827 | ->willReturnCallback( |
| 828 | - function () use ($view, $path, &$wasLockedPost): void { |
|
| 828 | + function() use ($view, $path, &$wasLockedPost): void { |
|
| 829 | 829 | $wasLockedPost = $this->isFileLocked($view, $path, ILockingProvider::LOCK_SHARED); |
| 830 | 830 | $wasLockedPost = $wasLockedPost && !$this->isFileLocked($view, $path, ILockingProvider::LOCK_EXCLUSIVE); |
| 831 | 831 | } |
@@ -986,11 +986,11 @@ discard block |
||
| 986 | 986 | 'mask' => Constants::PERMISSION_ALL - Constants::PERMISSION_CREATE |
| 987 | 987 | ]); |
| 988 | 988 | |
| 989 | - $this->registerMount($this->user, $noCreateStorage, '/' . $this->user . '/files/root'); |
|
| 989 | + $this->registerMount($this->user, $noCreateStorage, '/'.$this->user.'/files/root'); |
|
| 990 | 990 | |
| 991 | 991 | $this->loginAsUser($this->user); |
| 992 | 992 | |
| 993 | - $view = new View('/' . $this->user . '/files'); |
|
| 993 | + $view = new View('/'.$this->user.'/files'); |
|
| 994 | 994 | |
| 995 | 995 | $info = $view->getFileInfo('root/file.txt'); |
| 996 | 996 | |
@@ -1008,11 +1008,11 @@ discard block |
||
| 1008 | 1008 | } |
| 1009 | 1009 | |
| 1010 | 1010 | public function testPutLockExpired(): void { |
| 1011 | - $view = new View('/' . $this->user . '/files/'); |
|
| 1011 | + $view = new View('/'.$this->user.'/files/'); |
|
| 1012 | 1012 | |
| 1013 | 1013 | $path = 'test-locking.txt'; |
| 1014 | 1014 | $info = new \OC\Files\FileInfo( |
| 1015 | - '/' . $this->user . '/files/' . $path, |
|
| 1015 | + '/'.$this->user.'/files/'.$path, |
|
| 1016 | 1016 | $this->getMockStorage(), |
| 1017 | 1017 | null, |
| 1018 | 1018 | [ |
@@ -107,7 +107,7 @@ discard block |
||
| 107 | 107 | |
| 108 | 108 | $this->tree->expects($this->any()) |
| 109 | 109 | ->method('getNodeForPath') |
| 110 | - ->with('/' . $path) |
|
| 110 | + ->with('/'.$path) |
|
| 111 | 111 | ->willReturn($this->createMock(INode::class)); |
| 112 | 112 | |
| 113 | 113 | $this->server->expects($this->any()) |
@@ -115,7 +115,7 @@ discard block |
||
| 115 | 115 | ->willReturn($path); |
| 116 | 116 | $this->plugin->initialize($this->server); |
| 117 | 117 | |
| 118 | - $this->assertNull($this->plugin->onReport(FilesReportPluginImplementation::REPORT_NAME, [], '/' . $path)); |
|
| 118 | + $this->assertNull($this->plugin->onReport(FilesReportPluginImplementation::REPORT_NAME, [], '/'.$path)); |
|
| 119 | 119 | } |
| 120 | 120 | |
| 121 | 121 | public function testOnReportInvalidReportName(): void { |
@@ -123,7 +123,7 @@ discard block |
||
| 123 | 123 | |
| 124 | 124 | $this->tree->expects($this->any()) |
| 125 | 125 | ->method('getNodeForPath') |
| 126 | - ->with('/' . $path) |
|
| 126 | + ->with('/'.$path) |
|
| 127 | 127 | ->willReturn( |
| 128 | 128 | $this->getMockBuilder(INode::class) |
| 129 | 129 | ->disableOriginalConstructor() |
@@ -135,7 +135,7 @@ discard block |
||
| 135 | 135 | ->willReturn($path); |
| 136 | 136 | $this->plugin->initialize($this->server); |
| 137 | 137 | |
| 138 | - $this->assertNull($this->plugin->onReport('{whoever}whatever', [], '/' . $path)); |
|
| 138 | + $this->assertNull($this->plugin->onReport('{whoever}whatever', [], '/'.$path)); |
|
| 139 | 139 | } |
| 140 | 140 | |
| 141 | 141 | public function testOnReport(): void { |
@@ -182,7 +182,7 @@ discard block |
||
| 182 | 182 | |
| 183 | 183 | $this->tree->expects($this->any()) |
| 184 | 184 | ->method('getNodeForPath') |
| 185 | - ->with('/' . $path) |
|
| 185 | + ->with('/'.$path) |
|
| 186 | 186 | ->willReturn($reportTargetNode); |
| 187 | 187 | |
| 188 | 188 | $filesNode1 = $this->createMock(File::class); |
@@ -227,7 +227,7 @@ discard block |
||
| 227 | 227 | $this->server->httpResponse = $response; |
| 228 | 228 | $this->plugin->initialize($this->server); |
| 229 | 229 | |
| 230 | - $this->assertFalse($this->plugin->onReport(FilesReportPluginImplementation::REPORT_NAME, $parameters, '/' . $path)); |
|
| 230 | + $this->assertFalse($this->plugin->onReport(FilesReportPluginImplementation::REPORT_NAME, $parameters, '/'.$path)); |
|
| 231 | 231 | } |
| 232 | 232 | |
| 233 | 233 | public function testFindNodesByFileIdsRoot(): void { |
@@ -36,7 +36,7 @@ |
||
| 36 | 36 | private IURLGenerator&MockObject $urlGenerator; |
| 37 | 37 | private PublicAuth $auth; |
| 38 | 38 | |
| 39 | - private bool|string $oldUser; |
|
| 39 | + private bool | string $oldUser; |
|
| 40 | 40 | |
| 41 | 41 | protected function setUp(): void { |
| 42 | 42 | parent::setUp(); |
@@ -39,8 +39,8 @@ discard block |
||
| 39 | 39 | [Constants::PERMISSION_ALL, 'dir', false, Constants::PERMISSION_ALL, false, 'test', 'RGDNVCK'], |
| 40 | 40 | [Constants::PERMISSION_ALL, 'file', true, Constants::PERMISSION_ALL, false, 'test', 'SRGDNVW'], |
| 41 | 41 | [Constants::PERMISSION_ALL, 'file', true, Constants::PERMISSION_ALL, true, 'test', 'SRMGDNVW'], |
| 42 | - [Constants::PERMISSION_ALL, 'file', true, Constants::PERMISSION_ALL, true, '' , 'SRMGDNVW'], |
|
| 43 | - [Constants::PERMISSION_ALL, 'file', true, Constants::PERMISSION_ALL - Constants::PERMISSION_UPDATE, true, '' , 'SRMGDNV'], |
|
| 42 | + [Constants::PERMISSION_ALL, 'file', true, Constants::PERMISSION_ALL, true, '', 'SRMGDNVW'], |
|
| 43 | + [Constants::PERMISSION_ALL, 'file', true, Constants::PERMISSION_ALL - Constants::PERMISSION_UPDATE, true, '', 'SRMGDNV'], |
|
| 44 | 44 | [Constants::PERMISSION_ALL - Constants::PERMISSION_SHARE, 'file', true, Constants::PERMISSION_ALL, false, 'test', 'SGDNVW'], |
| 45 | 45 | [Constants::PERMISSION_ALL - Constants::PERMISSION_UPDATE, 'file', false, Constants::PERMISSION_ALL, false, 'test', 'RGD'], |
| 46 | 46 | [Constants::PERMISSION_ALL - Constants::PERMISSION_DELETE, 'file', false, Constants::PERMISSION_ALL, false, 'test', 'RGNVW'], |
@@ -70,7 +70,7 @@ discard block |
||
| 70 | 70 | $info->method('getInternalPath') |
| 71 | 71 | ->willReturn($internalPath); |
| 72 | 72 | $info->method('getMountPoint') |
| 73 | - ->willReturnCallback(function () use ($shared) { |
|
| 73 | + ->willReturnCallback(function() use ($shared) { |
|
| 74 | 74 | if ($shared) { |
| 75 | 75 | return $this->createMock(SharedMount::class); |
| 76 | 76 | } else { |
@@ -245,7 +245,7 @@ discard block |
||
| 245 | 245 | /** |
| 246 | 246 | * @dataProvider sanitizeMtimeProvider |
| 247 | 247 | */ |
| 248 | - public function testSanitizeMtime(string|int $mtime, int $expected): void { |
|
| 248 | + public function testSanitizeMtime(string | int $mtime, int $expected): void { |
|
| 249 | 249 | $view = $this->getMockBuilder(View::class) |
| 250 | 250 | ->disableOriginalConstructor() |
| 251 | 251 | ->getMock(); |
@@ -267,7 +267,7 @@ discard block |
||
| 267 | 267 | /** |
| 268 | 268 | * @dataProvider invalidSanitizeMtimeProvider |
| 269 | 269 | */ |
| 270 | - public function testInvalidSanitizeMtime(int|string $mtime): void { |
|
| 270 | + public function testInvalidSanitizeMtime(int | string $mtime): void { |
|
| 271 | 271 | $this->expectException(\InvalidArgumentException::class); |
| 272 | 272 | |
| 273 | 273 | $view = $this->createMock(View::class); |