diff options
Diffstat (limited to 'apps/files_versions/lib')
-rw-r--r-- | apps/files_versions/lib/AppInfo/Application.php | 2 | ||||
-rw-r--r-- | apps/files_versions/lib/BackgroundJob/ExpireVersions.php | 2 | ||||
-rw-r--r-- | apps/files_versions/lib/Capabilities.php | 2 | ||||
-rw-r--r-- | apps/files_versions/lib/Command/CleanUp.php | 1 | ||||
-rw-r--r-- | apps/files_versions/lib/Command/ExpireVersions.php | 2 | ||||
-rw-r--r-- | apps/files_versions/lib/Expiration.php | 18 | ||||
-rw-r--r-- | apps/files_versions/lib/Hooks.php | 2 | ||||
-rw-r--r-- | apps/files_versions/lib/Listener/LoadAdditionalListener.php | 2 | ||||
-rw-r--r-- | apps/files_versions/lib/Listener/LoadSidebarListener.php | 2 | ||||
-rw-r--r-- | apps/files_versions/lib/Storage.php | 8 |
10 files changed, 20 insertions, 21 deletions
diff --git a/apps/files_versions/lib/AppInfo/Application.php b/apps/files_versions/lib/AppInfo/Application.php index 32ba9d40505..040b72a8f0a 100644 --- a/apps/files_versions/lib/AppInfo/Application.php +++ b/apps/files_versions/lib/AppInfo/Application.php @@ -75,7 +75,7 @@ class Application extends App { ); }); - $container->registerService(IVersionManager::class, function(IAppContainer $c) { + $container->registerService(IVersionManager::class, function (IAppContainer $c) { return new VersionManager(); }); diff --git a/apps/files_versions/lib/BackgroundJob/ExpireVersions.php b/apps/files_versions/lib/BackgroundJob/ExpireVersions.php index cb2e0abb0c4..eb4287376e9 100644 --- a/apps/files_versions/lib/BackgroundJob/ExpireVersions.php +++ b/apps/files_versions/lib/BackgroundJob/ExpireVersions.php @@ -58,7 +58,7 @@ class ExpireVersions extends \OC\BackgroundJob\TimedJob { return; } - $this->userManager->callForSeenUsers(function(IUser $user) { + $this->userManager->callForSeenUsers(function (IUser $user) { $uid = $user->getUID(); if (!$this->setupFS($uid)) { return; diff --git a/apps/files_versions/lib/Capabilities.php b/apps/files_versions/lib/Capabilities.php index b1e7ec468d3..4761fdb477c 100644 --- a/apps/files_versions/lib/Capabilities.php +++ b/apps/files_versions/lib/Capabilities.php @@ -23,7 +23,7 @@ * */ -namespace OCA\Files_Versions; +namespace OCA\Files_Versions; use OCP\Capabilities\ICapability; diff --git a/apps/files_versions/lib/Command/CleanUp.php b/apps/files_versions/lib/Command/CleanUp.php index 6abf5bdb3c8..b5b8f3dcfdb 100644 --- a/apps/files_versions/lib/Command/CleanUp.php +++ b/apps/files_versions/lib/Command/CleanUp.php @@ -22,7 +22,6 @@ namespace OCA\Files_Versions\Command; - use OCP\Files\IRootFolder; use OCP\IUserBackend; use OCP\IUserManager; diff --git a/apps/files_versions/lib/Command/ExpireVersions.php b/apps/files_versions/lib/Command/ExpireVersions.php index ba12ce2a496..d67542db259 100644 --- a/apps/files_versions/lib/Command/ExpireVersions.php +++ b/apps/files_versions/lib/Command/ExpireVersions.php @@ -91,7 +91,7 @@ class ExpireVersions extends Command { } else { $p = new ProgressBar($output); $p->start(); - $this->userManager->callForSeenUsers(function(IUser $user) use ($p) { + $this->userManager->callForSeenUsers(function (IUser $user) use ($p) { $p->advance(); $this->expireVersionsForUser($user); }); diff --git a/apps/files_versions/lib/Expiration.php b/apps/files_versions/lib/Expiration.php index 9f3f524ec12..a56042e76b8 100644 --- a/apps/files_versions/lib/Expiration.php +++ b/apps/files_versions/lib/Expiration.php @@ -47,7 +47,7 @@ class Expiration { /** @var bool */ private $canPurgeToSaveSpace; - public function __construct(IConfig $config,ITimeFactory $timeFactory){ + public function __construct(IConfig $config,ITimeFactory $timeFactory) { $this->timeFactory = $timeFactory; $this->retentionObligation = $config->getSystemValue('versions_retention_obligation', 'auto'); @@ -60,14 +60,14 @@ class Expiration { * Is versions expiration enabled * @return bool */ - public function isEnabled(){ + public function isEnabled() { return $this->retentionObligation !== 'disabled'; } /** * Is default expiration active */ - public function shouldAutoExpire(){ + public function shouldAutoExpire() { return $this->minAge === self::NO_OBLIGATION || $this->maxAge === self::NO_OBLIGATION; } @@ -78,7 +78,7 @@ class Expiration { * @param bool $quotaExceeded * @return bool */ - public function isExpired($timestamp, $quotaExceeded = false){ + public function isExpired($timestamp, $quotaExceeded = false) { // No expiration if disabled if (!$this->isEnabled()) { return false; @@ -119,7 +119,7 @@ class Expiration { * Get maximal retention obligation as a timestamp * @return int */ - public function getMaxAgeAsTimestamp(){ + public function getMaxAgeAsTimestamp() { $maxAge = false; if ($this->isEnabled() && $this->maxAge !== self::NO_OBLIGATION) { $time = $this->timeFactory->getTime(); @@ -129,10 +129,10 @@ class Expiration { } /** - * Read versions_retention_obligation, validate it - * and set private members accordingly - */ - private function parseRetentionObligation(){ + * Read versions_retention_obligation, validate it + * and set private members accordingly + */ + private function parseRetentionObligation() { $splitValues = explode(',', $this->retentionObligation); if (!isset($splitValues[0])) { $minValue = 'auto'; diff --git a/apps/files_versions/lib/Hooks.php b/apps/files_versions/lib/Hooks.php index b45b082865d..179a404ed9a 100644 --- a/apps/files_versions/lib/Hooks.php +++ b/apps/files_versions/lib/Hooks.php @@ -56,7 +56,7 @@ class Hooks { /** * listen to write event. */ - public static function write_hook( $params ) { + public static function write_hook($params) { $path = $params[Filesystem::signal_param_path]; if($path !== '') { Storage::store($path); diff --git a/apps/files_versions/lib/Listener/LoadAdditionalListener.php b/apps/files_versions/lib/Listener/LoadAdditionalListener.php index 0d8c380915c..f6d67341074 100644 --- a/apps/files_versions/lib/Listener/LoadAdditionalListener.php +++ b/apps/files_versions/lib/Listener/LoadAdditionalListener.php @@ -39,7 +39,7 @@ class LoadAdditionalListener implements IEventListener { return; } - // TODO: make sure to only include the sidebar script when + // TODO: make sure to only include the sidebar script when // we properly split it between files list and sidebar Util::addScript(Application::APP_ID, 'files_versions'); } diff --git a/apps/files_versions/lib/Listener/LoadSidebarListener.php b/apps/files_versions/lib/Listener/LoadSidebarListener.php index ac877620e71..875fe8b3fc5 100644 --- a/apps/files_versions/lib/Listener/LoadSidebarListener.php +++ b/apps/files_versions/lib/Listener/LoadSidebarListener.php @@ -39,7 +39,7 @@ class LoadSidebarListener implements IEventListener { return; } - // TODO: make sure to only include the sidebar script when + // TODO: make sure to only include the sidebar script when // we properly split it between files list and sidebar Util::addScript(Application::APP_ID, 'files_versions'); } diff --git a/apps/files_versions/lib/Storage.php b/apps/files_versions/lib/Storage.php index b1d6c689c61..8150089c078 100644 --- a/apps/files_versions/lib/Storage.php +++ b/apps/files_versions/lib/Storage.php @@ -107,7 +107,7 @@ class Storage { $uid = User::getUser(); } Filesystem::initMountPoints($uid); - if ( $uid !== User::getUser() ) { + if ($uid !== User::getUser()) { $info = Filesystem::getFileInfo($filename); $ownerView = new View('/'.$uid.'/files'); try { @@ -497,7 +497,7 @@ class Storage { * Expire versions that older than max version retention time * @param string $uid */ - public static function expireOlderThanMaxForUser($uid){ + public static function expireOlderThanMaxForUser($uid) { $expiration = self::getExpiration(); $threshold = $expiration->getMaxAgeAsTimestamp(); $versions = self::getAllVersions($uid); @@ -735,7 +735,7 @@ class Storage { $softQuota = true; $quota = $user->getQuota(); - if ( $quota === null || $quota === 'none' ) { + if ($quota === null || $quota === 'none') { $quota = Filesystem::free_space('/'); $softQuota = false; } else { @@ -848,7 +848,7 @@ class Storage { * Static workaround * @return Expiration */ - protected static function getExpiration(){ + protected static function getExpiration() { if (self::$application === null) { self::$application = \OC::$server->query(Application::class); } |