diff options
Diffstat (limited to 'apps/files_trashbin')
-rw-r--r-- | apps/files_trashbin/lib/AppInfo/Application.php | 4 | ||||
-rw-r--r-- | apps/files_trashbin/lib/BackgroundJob/ExpireTrash.php | 2 | ||||
-rw-r--r-- | apps/files_trashbin/lib/Command/ExpireTrash.php | 2 | ||||
-rw-r--r-- | apps/files_trashbin/lib/Expiration.php | 8 | ||||
-rw-r--r-- | apps/files_trashbin/lib/Trashbin.php | 4 | ||||
-rw-r--r-- | apps/files_trashbin/tests/ExpirationTest.php | 16 |
6 files changed, 18 insertions, 18 deletions
diff --git a/apps/files_trashbin/lib/AppInfo/Application.php b/apps/files_trashbin/lib/AppInfo/Application.php index 59f1b1d8c56..6a810e9218e 100644 --- a/apps/files_trashbin/lib/AppInfo/Application.php +++ b/apps/files_trashbin/lib/AppInfo/Application.php @@ -36,7 +36,7 @@ use OCP\AppFramework\App; use OCP\AppFramework\IAppContainer; class Application extends App { - public function __construct (array $urlParams = []) { + public function __construct(array $urlParams = []) { parent::__construct('files_trashbin', $urlParams); $container = $this->getContainer(); @@ -65,7 +65,7 @@ class Application extends App { ); }); - $container->registerService(ITrashManager::class, function(IAppContainer $c) { + $container->registerService(ITrashManager::class, function (IAppContainer $c) { return new TrashManager(); }); diff --git a/apps/files_trashbin/lib/BackgroundJob/ExpireTrash.php b/apps/files_trashbin/lib/BackgroundJob/ExpireTrash.php index 2e9395980a9..3de365bd849 100644 --- a/apps/files_trashbin/lib/BackgroundJob/ExpireTrash.php +++ b/apps/files_trashbin/lib/BackgroundJob/ExpireTrash.php @@ -80,7 +80,7 @@ class ExpireTrash 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_trashbin/lib/Command/ExpireTrash.php b/apps/files_trashbin/lib/Command/ExpireTrash.php index 6b35f781a56..46d2de46e36 100644 --- a/apps/files_trashbin/lib/Command/ExpireTrash.php +++ b/apps/files_trashbin/lib/Command/ExpireTrash.php @@ -92,7 +92,7 @@ class ExpireTrash 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->expireTrashForUser($user); }); diff --git a/apps/files_trashbin/lib/Expiration.php b/apps/files_trashbin/lib/Expiration.php index 03c45ad4a6d..9a660f9e942 100644 --- a/apps/files_trashbin/lib/Expiration.php +++ b/apps/files_trashbin/lib/Expiration.php @@ -50,7 +50,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->setRetentionObligation($config->getSystemValue('trashbin_retention_obligation', 'auto')); } @@ -67,7 +67,7 @@ class Expiration { * Is trashbin expiration enabled * @return bool */ - public function isEnabled(){ + public function isEnabled() { return $this->retentionObligation !== 'disabled'; } @@ -77,7 +77,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; @@ -126,7 +126,7 @@ class Expiration { return $maxAge; } - private function parseRetentionObligation(){ + private function parseRetentionObligation() { $splitValues = explode(',', $this->retentionObligation); if (!isset($splitValues[0])) { $minValue = self::DEFAULT_RETENTION_OBLIGATION; diff --git a/apps/files_trashbin/lib/Trashbin.php b/apps/files_trashbin/lib/Trashbin.php index 0f1787223a2..24d49a4c8c5 100644 --- a/apps/files_trashbin/lib/Trashbin.php +++ b/apps/files_trashbin/lib/Trashbin.php @@ -549,7 +549,7 @@ class Trashbin { * wrapper function to emit the 'preDelete' hook of \OCP\Trashbin before a file is deleted * @param string $path */ - protected static function emitTrashbinPreDelete($path){ + protected static function emitTrashbinPreDelete($path) { \OC_Hook::emit('\OCP\Trashbin', 'preDelete', ['path' => $path]); } @@ -557,7 +557,7 @@ class Trashbin { * wrapper function to emit the 'delete' hook of \OCP\Trashbin after a file has been deleted * @param string $path */ - protected static function emitTrashbinPostDelete($path){ + protected static function emitTrashbinPostDelete($path) { \OC_Hook::emit('\OCP\Trashbin', 'delete', ['path' => $path]); } diff --git a/apps/files_trashbin/tests/ExpirationTest.php b/apps/files_trashbin/tests/ExpirationTest.php index 5a21889e457..581ef247ac7 100644 --- a/apps/files_trashbin/tests/ExpirationTest.php +++ b/apps/files_trashbin/tests/ExpirationTest.php @@ -32,7 +32,7 @@ class ExpirationTest extends \Test\TestCase { const FAKE_TIME_NOW = 1000000; - public function expirationData(){ + public function expirationData() { $today = 100*self::SECONDS_PER_DAY; $back10Days = (100-10)*self::SECONDS_PER_DAY; $back20Days = (100-20)*self::SECONDS_PER_DAY; @@ -105,7 +105,7 @@ class ExpirationTest extends \Test\TestCase { * @param bool $quotaExceeded * @param string $expectedResult */ - public function testExpiration($retentionObligation, $timeNow, $timestamp, $quotaExceeded, $expectedResult){ + public function testExpiration($retentionObligation, $timeNow, $timestamp, $quotaExceeded, $expectedResult) { $mockedConfig = $this->getMockedConfig($retentionObligation); $mockedTimeFactory = $this->getMockedTimeFactory($timeNow); @@ -116,7 +116,7 @@ class ExpirationTest extends \Test\TestCase { } - public function configData(){ + public function configData() { return [ [ 'disabled', null, null, null], [ 'auto', Expiration::DEFAULT_RETENTION_OBLIGATION, Expiration::NO_OBLIGATION, true ], @@ -138,7 +138,7 @@ class ExpirationTest extends \Test\TestCase { * @param int $expectedMaxAge * @param bool $expectedCanPurgeToSaveSpace */ - public function testParseRetentionObligation($configValue, $expectedMinAge, $expectedMaxAge, $expectedCanPurgeToSaveSpace){ + public function testParseRetentionObligation($configValue, $expectedMinAge, $expectedMaxAge, $expectedCanPurgeToSaveSpace) { $mockedConfig = $this->getMockedConfig($configValue); $mockedTimeFactory = $this->getMockedTimeFactory( time() @@ -151,7 +151,7 @@ class ExpirationTest extends \Test\TestCase { } - public function timestampTestData(){ + public function timestampTestData() { return [ [ 'disabled', false], [ 'auto', false ], @@ -171,7 +171,7 @@ class ExpirationTest extends \Test\TestCase { * @param string $configValue * @param int $expectedMaxAgeTimestamp */ - public function testGetMaxAgeAsTimestamp($configValue, $expectedMaxAgeTimestamp){ + public function testGetMaxAgeAsTimestamp($configValue, $expectedMaxAgeTimestamp) { $mockedConfig = $this->getMockedConfig($configValue); $mockedTimeFactory = $this->getMockedTimeFactory( self::FAKE_TIME_NOW @@ -186,7 +186,7 @@ class ExpirationTest extends \Test\TestCase { * @param int $time * @return ITimeFactory|MockObject */ - private function getMockedTimeFactory($time){ + private function getMockedTimeFactory($time) { $mockedTimeFactory = $this->createMock(ITimeFactory::class); $mockedTimeFactory->expects($this->any()) ->method('getTime') @@ -199,7 +199,7 @@ class ExpirationTest extends \Test\TestCase { * @param string $returnValue * @return IConfig|MockObject */ - private function getMockedConfig($returnValue){ + private function getMockedConfig($returnValue) { $mockedConfig = $this->createMock(IConfig::class); $mockedConfig->expects($this->any()) ->method('getSystemValue') |