aboutsummaryrefslogtreecommitdiffstats
path: root/apps/files_trashbin/lib
diff options
context:
space:
mode:
authorChristoph Wurst <christoph@winzerhof-wurst.at>2019-10-11 08:33:09 +0200
committerChristoph Wurst <christoph@winzerhof-wurst.at>2019-10-11 08:33:09 +0200
commit543190f8b3228b994ba897c9a43fdc3f61adf663 (patch)
tree650022215976952462cef64f59c25e86fa20a006 /apps/files_trashbin/lib
parentf6a79338d4ea66f9c341d004951b606b5310b478 (diff)
downloadnextcloud-server-543190f8b3228b994ba897c9a43fdc3f61adf663.tar.gz
nextcloud-server-543190f8b3228b994ba897c9a43fdc3f61adf663.zip
Do not create Application instances directly
Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
Diffstat (limited to 'apps/files_trashbin/lib')
-rw-r--r--apps/files_trashbin/lib/BackgroundJob/ExpireTrash.php3
-rw-r--r--apps/files_trashbin/lib/Trashbin.php9
2 files changed, 8 insertions, 4 deletions
diff --git a/apps/files_trashbin/lib/BackgroundJob/ExpireTrash.php b/apps/files_trashbin/lib/BackgroundJob/ExpireTrash.php
index e19b7ce604f..919317a7b7a 100644
--- a/apps/files_trashbin/lib/BackgroundJob/ExpireTrash.php
+++ b/apps/files_trashbin/lib/BackgroundJob/ExpireTrash.php
@@ -62,7 +62,8 @@ class ExpireTrash extends \OC\BackgroundJob\TimedJob {
}
protected function fixDIForJobs() {
- $application = new Application();
+ /** @var Application $application */
+ $application = \OC::$server->query(Application::class);
$this->userManager = \OC::$server->getUserManager();
$this->expiration = $application->getContainer()->query('Expiration');
}
diff --git a/apps/files_trashbin/lib/Trashbin.php b/apps/files_trashbin/lib/Trashbin.php
index a06a5145d99..bb1c9c172ec 100644
--- a/apps/files_trashbin/lib/Trashbin.php
+++ b/apps/files_trashbin/lib/Trashbin.php
@@ -747,7 +747,8 @@ class Trashbin {
*/
private static function scheduleExpire($user) {
// let the admin disable auto expire
- $application = new Application();
+ /** @var Application $application */
+ $application = \OC::$server->query(Application::class);
$expiration = $application->getContainer()->query('Expiration');
if ($expiration->isEnabled()) {
\OC::$server->getCommandBus()->push(new Expire($user));
@@ -764,7 +765,8 @@ class Trashbin {
* @return int size of deleted files
*/
protected static function deleteFiles($files, $user, $availableSpace) {
- $application = new Application();
+ /** @var Application $application */
+ $application = \OC::$server->query(Application::class);
$expiration = $application->getContainer()->query('Expiration');
$size = 0;
@@ -791,7 +793,8 @@ class Trashbin {
* @return integer[] size of deleted files and number of deleted files
*/
public static function deleteExpiredFiles($files, $user) {
- $application = new Application();
+ /** @var Application $application */
+ $application = \OC::$server->query(Application::class);
$expiration = $application->getContainer()->query('Expiration');
$size = 0;
$count = 0;