diff options
author | provokateurin <kate@provokateurin.de> | 2024-09-19 11:10:31 +0200 |
---|---|---|
committer | provokateurin <kate@provokateurin.de> | 2024-09-19 14:21:20 +0200 |
commit | 9836e9b16484582d309c8437ab46d82e34956941 (patch) | |
tree | d3da87bb7dfd1a8877ed25072ecf609def844089 /apps/files_versions | |
parent | 8c60ffa0f21414e6e671c567d664a9b9e5253e26 (diff) | |
download | nextcloud-server-9836e9b16484582d309c8437ab46d82e34956941.tar.gz nextcloud-server-9836e9b16484582d309c8437ab46d82e34956941.zip |
chore(deps): Update nextcloud/coding-standard to v1.3.1
Signed-off-by: provokateurin <kate@provokateurin.de>
Diffstat (limited to 'apps/files_versions')
-rw-r--r-- | apps/files_versions/lib/Capabilities.php | 2 | ||||
-rw-r--r-- | apps/files_versions/lib/Controller/PreviewController.php | 4 | ||||
-rw-r--r-- | apps/files_versions/lib/Sabre/RootCollection.php | 2 | ||||
-rw-r--r-- | apps/files_versions/lib/Sabre/VersionFile.php | 2 | ||||
-rw-r--r-- | apps/files_versions/lib/Storage.php | 34 |
5 files changed, 22 insertions, 22 deletions
diff --git a/apps/files_versions/lib/Capabilities.php b/apps/files_versions/lib/Capabilities.php index ce7239a4bf5..3566b82842a 100644 --- a/apps/files_versions/lib/Capabilities.php +++ b/apps/files_versions/lib/Capabilities.php @@ -16,7 +16,7 @@ class Capabilities implements ICapability { public function __construct( IConfig $config, - IAppManager $appManager + IAppManager $appManager, ) { $this->config = $config; $this->appManager = $appManager; diff --git a/apps/files_versions/lib/Controller/PreviewController.php b/apps/files_versions/lib/Controller/PreviewController.php index 8416503c643..4cda69beb96 100644 --- a/apps/files_versions/lib/Controller/PreviewController.php +++ b/apps/files_versions/lib/Controller/PreviewController.php @@ -38,7 +38,7 @@ class PreviewController extends Controller { IRootFolder $rootFolder, IUserSession $userSession, IVersionManager $versionManager, - IPreview $previewManager + IPreview $previewManager, ) { parent::__construct($appName, $request); @@ -67,7 +67,7 @@ class PreviewController extends Controller { string $file = '', int $x = 44, int $y = 44, - string $version = '' + string $version = '', ) { if ($file === '' || $version === '' || $x === 0 || $y === 0) { return new DataResponse([], Http::STATUS_BAD_REQUEST); diff --git a/apps/files_versions/lib/Sabre/RootCollection.php b/apps/files_versions/lib/Sabre/RootCollection.php index 8ed397069f7..2d59acdada0 100644 --- a/apps/files_versions/lib/Sabre/RootCollection.php +++ b/apps/files_versions/lib/Sabre/RootCollection.php @@ -34,7 +34,7 @@ class RootCollection extends AbstractPrincipalCollection { IConfig $config, IUserManager $userManager, IVersionManager $versionManager, - IUserSession $userSession + IUserSession $userSession, ) { parent::__construct($principalBackend, 'principals/users'); diff --git a/apps/files_versions/lib/Sabre/VersionFile.php b/apps/files_versions/lib/Sabre/VersionFile.php index 94fc101f05e..faa03473648 100644 --- a/apps/files_versions/lib/Sabre/VersionFile.php +++ b/apps/files_versions/lib/Sabre/VersionFile.php @@ -23,7 +23,7 @@ use Sabre\DAV\IFile; class VersionFile implements IFile { public function __construct( private IVersion $version, - private IVersionManager $versionManager + private IVersionManager $versionManager, ) { } diff --git a/apps/files_versions/lib/Storage.php b/apps/files_versions/lib/Storage.php index 41f04b5a1d1..af14f8e4b9f 100644 --- a/apps/files_versions/lib/Storage.php +++ b/apps/files_versions/lib/Storage.php @@ -91,7 +91,7 @@ class Storage { Filesystem::initMountPoints($uid); if ($uid !== OC_User::getUser()) { $info = Filesystem::getFileInfo($filename); - $ownerView = new View('/'.$uid.'/files'); + $ownerView = new View('/' . $uid . '/files'); try { $filename = $ownerView->getPath($info['fileid']); // make sure that the file name doesn't end with a trailing slash @@ -303,7 +303,7 @@ class Storage { // does the directory exists for versions too ? if ($rootView->is_dir('/' . $sourceOwner . '/files_versions/' . $sourcePath)) { // create missing dirs if necessary - self::createMissingDirectories($targetPath, new View('/'. $targetOwner)); + self::createMissingDirectories($targetPath, new View('/' . $targetOwner)); // move the directory containing the versions $rootView->$operation( @@ -313,13 +313,13 @@ class Storage { } } elseif ($versions = Storage::getVersions($sourceOwner, '/' . $sourcePath)) { // create missing dirs if necessary - self::createMissingDirectories($targetPath, new View('/'. $targetOwner)); + self::createMissingDirectories($targetPath, new View('/' . $targetOwner)); foreach ($versions as $v) { // move each version one by one to the target directory $rootView->$operation( - '/' . $sourceOwner . '/files_versions/' . $sourcePath.'.v' . $v['version'], - '/' . $targetOwner . '/files_versions/' . $targetPath.'.v' . $v['version'] + '/' . $sourceOwner . '/files_versions/' . $sourcePath . '.v' . $v['version'], + '/' . $targetOwner . '/files_versions/' . $targetPath . '.v' . $v['version'] ); } } @@ -345,8 +345,8 @@ class Storage { $root = \OC::$server->get(IRootFolder::class); $userFolder = $root->getUserFolder($user->getUID()); - $users_view = new View('/'.$user->getUID()); - $files_view = new View('/'. $user->getUID().'/files'); + $users_view = new View('/' . $user->getUID()); + $files_view = new View('/' . $user->getUID() . '/files'); $versionCreated = false; @@ -358,9 +358,9 @@ class Storage { } //first create a new version - $version = 'files_versions'.$filename.'.v'.$users_view->filemtime('files'.$filename); + $version = 'files_versions' . $filename . '.v' . $users_view->filemtime('files' . $filename); if (!$users_view->file_exists($version)) { - $users_view->copy('files'.$filename, 'files_versions'.$filename.'.v'.$users_view->filemtime('files'.$filename)); + $users_view->copy('files' . $filename, 'files_versions' . $filename . '.v' . $users_view->filemtime('files' . $filename)); $versionCreated = true; } @@ -562,7 +562,7 @@ class Storage { } try { - $node = $userFolder->get(substr($path, 0, -strlen('.v'.$version))); + $node = $userFolder->get(substr($path, 0, -strlen('.v' . $version))); $versionEntity = $versionsMapper->findVersionForFileId($node->getId(), $version); $versionEntities[$info->getId()] = $versionEntity; @@ -668,7 +668,7 @@ class Storage { ]; foreach ($versions as $key => $value) { - $size = $view->filesize(self::VERSIONS_ROOT.'/'.$value['path'].'.v'.$value['timestamp']); + $size = $view->filesize(self::VERSIONS_ROOT . '/' . $value['path'] . '.v' . $value['timestamp']); $filename = $value['path']; $result['all'][$key]['version'] = $value['timestamp']; @@ -703,7 +703,7 @@ class Storage { foreach ($versions as $key => $version) { if (!is_numeric($version['version'])) { \OC::$server->get(LoggerInterface::class)->error( - 'Found a non-numeric timestamp version: '. json_encode($version), + 'Found a non-numeric timestamp version: ' . json_encode($version), ['app' => 'files_versions']); continue; } @@ -753,7 +753,7 @@ class Storage { //distance between two version too small, mark to delete $toDelete[$key] = $version['path'] . '.v' . $version['version']; $size += $version['size']; - \OC::$server->get(LoggerInterface::class)->info('Mark to expire '. $version['path'] .' next version should be ' . $nextVersion . ' or smaller. (prevTimestamp: ' . $prevTimestamp . '; step: ' . $step, ['app' => 'files_versions']); + \OC::$server->get(LoggerInterface::class)->info('Mark to expire ' . $version['path'] . ' next version should be ' . $nextVersion . ' or smaller. (prevTimestamp: ' . $prevTimestamp . '; step: ' . $step, ['app' => 'files_versions']); } else { $nextVersion = $version['version'] - $step; $prevTimestamp = $version['version']; @@ -833,7 +833,7 @@ class Storage { // file maybe renamed or deleted return false; } - $versionsFileview = new View('/'.$uid.'/files_versions'); + $versionsFileview = new View('/' . $uid . '/files_versions'); $softQuota = true; $quota = $user->getQuota(); @@ -925,10 +925,10 @@ class Storage { reset($allVersions); while ($availableSpace < 0 && $i < $numOfVersions) { $version = current($allVersions); - \OC_Hook::emit('\OCP\Versions', 'preDelete', ['path' => $version['path'].'.v'.$version['version'], 'trigger' => self::DELETE_TRIGGER_QUOTA_EXCEEDED]); + \OC_Hook::emit('\OCP\Versions', 'preDelete', ['path' => $version['path'] . '.v' . $version['version'], 'trigger' => self::DELETE_TRIGGER_QUOTA_EXCEEDED]); self::deleteVersion($versionsFileview, $version['path'] . '.v' . $version['version']); - \OC_Hook::emit('\OCP\Versions', 'delete', ['path' => $version['path'].'.v'.$version['version'], 'trigger' => self::DELETE_TRIGGER_QUOTA_EXCEEDED]); - $logger->info('running out of space! Delete oldest version: ' . $version['path'].'.v'.$version['version'], ['app' => 'files_versions']); + \OC_Hook::emit('\OCP\Versions', 'delete', ['path' => $version['path'] . '.v' . $version['version'], 'trigger' => self::DELETE_TRIGGER_QUOTA_EXCEEDED]); + $logger->info('running out of space! Delete oldest version: ' . $version['path'] . '.v' . $version['version'], ['app' => 'files_versions']); $versionsSize -= $version['size']; $availableSpace += $version['size']; next($allVersions); |