aboutsummaryrefslogtreecommitdiffstats
path: root/apps/admin_audit
diff options
context:
space:
mode:
authorCôme Chilliet <come.chilliet@nextcloud.com>2024-10-10 12:40:31 +0200
committerCôme Chilliet <come.chilliet@nextcloud.com>2024-10-15 10:40:25 +0200
commit1580c8612b01bfa780d1a7372080a27d182fb7dd (patch)
treeb2776d0cd254ac9d6e54828978ce18b702f550d5 /apps/admin_audit
parent4ff9b3e0ce53227e2be47c4c2dcb1fdc3e540b5f (diff)
downloadnextcloud-server-1580c8612b01bfa780d1a7372080a27d182fb7dd.tar.gz
nextcloud-server-1580c8612b01bfa780d1a7372080a27d182fb7dd.zip
chore(apps): Apply new rector configuration to autouse classes
Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
Diffstat (limited to 'apps/admin_audit')
-rw-r--r--apps/admin_audit/lib/Actions/Files.php15
-rw-r--r--apps/admin_audit/lib/AppInfo/Application.php3
-rw-r--r--apps/admin_audit/lib/Listener/FileEventListener.php3
3 files changed, 12 insertions, 9 deletions
diff --git a/apps/admin_audit/lib/Actions/Files.php b/apps/admin_audit/lib/Actions/Files.php
index 73cfd00b382..3993f1a76ee 100644
--- a/apps/admin_audit/lib/Actions/Files.php
+++ b/apps/admin_audit/lib/Actions/Files.php
@@ -17,6 +17,7 @@ use OCP\Files\Events\Node\NodeRenamedEvent;
use OCP\Files\Events\Node\NodeWrittenEvent;
use OCP\Files\InvalidPathException;
use OCP\Files\NotFoundException;
+use OCP\Server;
use Psr\Log\LoggerInterface;
/**
@@ -39,7 +40,7 @@ class Files extends Action {
'path' => mb_substr($node->getInternalPath(), 5),
];
} catch (InvalidPathException|NotFoundException $e) {
- \OCP\Server::get(LoggerInterface::class)->error(
+ Server::get(LoggerInterface::class)->error(
'Exception thrown in file read: ' . $e->getMessage(), ['app' => 'admin_audit', 'exception' => $e]
);
return;
@@ -59,7 +60,7 @@ class Files extends Action {
$source = $event->getSource();
$this->renamedNodes[$source->getId()] = $source;
} catch (InvalidPathException|NotFoundException $e) {
- \OCP\Server::get(LoggerInterface::class)->error(
+ Server::get(LoggerInterface::class)->error(
'Exception thrown in file rename: ' . $e->getMessage(), ['app' => 'admin_audit', 'exception' => $e]
);
return;
@@ -79,7 +80,7 @@ class Files extends Action {
'newpath' => mb_substr($target->getInternalPath(), 5),
];
} catch (InvalidPathException|NotFoundException $e) {
- \OCP\Server::get(LoggerInterface::class)->error(
+ Server::get(LoggerInterface::class)->error(
'Exception thrown in file rename: ' . $e->getMessage(), ['app' => 'admin_audit', 'exception' => $e]
);
return;
@@ -103,7 +104,7 @@ class Files extends Action {
'path' => mb_substr($event->getNode()->getInternalPath(), 5),
];
} catch (InvalidPathException|NotFoundException $e) {
- \OCP\Server::get(LoggerInterface::class)->error(
+ Server::get(LoggerInterface::class)->error(
'Exception thrown in file create: ' . $e->getMessage(), ['app' => 'admin_audit', 'exception' => $e]
);
return;
@@ -130,7 +131,7 @@ class Files extends Action {
'newpath' => mb_substr($event->getTarget()->getInternalPath(), 5),
];
} catch (InvalidPathException|NotFoundException $e) {
- \OCP\Server::get(LoggerInterface::class)->error(
+ Server::get(LoggerInterface::class)->error(
'Exception thrown in file copy: ' . $e->getMessage(), ['app' => 'admin_audit', 'exception' => $e]
);
return;
@@ -153,7 +154,7 @@ class Files extends Action {
'path' => mb_substr($node->getInternalPath(), 5),
];
} catch (InvalidPathException|NotFoundException $e) {
- \OCP\Server::get(LoggerInterface::class)->error(
+ Server::get(LoggerInterface::class)->error(
'Exception thrown in file write: ' . $e->getMessage(), ['app' => 'admin_audit', 'exception' => $e]
);
return;
@@ -179,7 +180,7 @@ class Files extends Action {
'path' => mb_substr($event->getNode()->getInternalPath(), 5),
];
} catch (InvalidPathException|NotFoundException $e) {
- \OCP\Server::get(LoggerInterface::class)->error(
+ Server::get(LoggerInterface::class)->error(
'Exception thrown in file delete: ' . $e->getMessage(), ['app' => 'admin_audit', 'exception' => $e]
);
return;
diff --git a/apps/admin_audit/lib/AppInfo/Application.php b/apps/admin_audit/lib/AppInfo/Application.php
index 48ee8ebe9d2..de45bb9bcdd 100644
--- a/apps/admin_audit/lib/AppInfo/Application.php
+++ b/apps/admin_audit/lib/AppInfo/Application.php
@@ -56,6 +56,7 @@ use OCP\Preview\BeforePreviewFetchedEvent;
use OCP\Share;
use OCP\Share\Events\ShareCreatedEvent;
use OCP\Share\Events\ShareDeletedEvent;
+use OCP\SystemTag\ManagerEvent;
use OCP\User\Events\BeforeUserLoggedInEvent;
use OCP\User\Events\BeforeUserLoggedOutEvent;
use OCP\User\Events\PasswordUpdatedEvent;
@@ -156,7 +157,7 @@ class Application extends App implements IBootstrap {
private function tagHooks(IAuditLogger $logger,
IEventDispatcher $eventDispatcher): void {
- $eventDispatcher->addListener(\OCP\SystemTag\ManagerEvent::EVENT_CREATE, function (\OCP\SystemTag\ManagerEvent $event) use ($logger): void {
+ $eventDispatcher->addListener(ManagerEvent::EVENT_CREATE, function (ManagerEvent $event) use ($logger): void {
$tagActions = new TagManagement($logger);
$tagActions->createTag($event->getTag());
});
diff --git a/apps/admin_audit/lib/Listener/FileEventListener.php b/apps/admin_audit/lib/Listener/FileEventListener.php
index 369f97239d7..4ea3db6aa7d 100644
--- a/apps/admin_audit/lib/Listener/FileEventListener.php
+++ b/apps/admin_audit/lib/Listener/FileEventListener.php
@@ -15,6 +15,7 @@ use OCP\EventDispatcher\IEventListener;
use OCP\Files\InvalidPathException;
use OCP\Files\NotFoundException;
use OCP\Preview\BeforePreviewFetchedEvent;
+use OCP\Server;
use Psr\Log\LoggerInterface;
/**
@@ -47,7 +48,7 @@ class FileEventListener extends Action implements IEventListener {
array_keys($params)
);
} catch (InvalidPathException|NotFoundException $e) {
- \OCP\Server::get(LoggerInterface::class)->error(
+ Server::get(LoggerInterface::class)->error(
'Exception thrown in file preview: ' . $e->getMessage(), ['app' => 'admin_audit', 'exception' => $e]
);
return;