aboutsummaryrefslogtreecommitdiffstats
path: root/apps/files/lib/Controller
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/files/lib/Controller
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/files/lib/Controller')
-rw-r--r--apps/files/lib/Controller/ApiController.php8
-rw-r--r--apps/files/lib/Controller/ViewController.php8
2 files changed, 10 insertions, 6 deletions
diff --git a/apps/files/lib/Controller/ApiController.php b/apps/files/lib/Controller/ApiController.php
index 0ca4a1efd4b..118a4fcb9e2 100644
--- a/apps/files/lib/Controller/ApiController.php
+++ b/apps/files/lib/Controller/ApiController.php
@@ -8,6 +8,7 @@
namespace OCA\Files\Controller;
use OC\Files\Node\Node;
+use OCA\Files\Helper;
use OCA\Files\ResponseDefinitions;
use OCA\Files\Service\TagService;
use OCA\Files\Service\UserConfig;
@@ -30,6 +31,7 @@ use OCP\Files\File;
use OCP\Files\Folder;
use OCP\Files\IRootFolder;
use OCP\Files\NotFoundException;
+use OCP\Files\StorageNotAvailableException;
use OCP\IConfig;
use OCP\IL10N;
use OCP\IPreview;
@@ -124,11 +126,11 @@ class ApiController extends Controller {
if (!is_null($tags)) {
try {
$this->tagService->updateFileTags($path, $tags);
- } catch (\OCP\Files\NotFoundException $e) {
+ } catch (NotFoundException $e) {
return new DataResponse([
'message' => $e->getMessage()
], Http::STATUS_NOT_FOUND);
- } catch (\OCP\Files\StorageNotAvailableException $e) {
+ } catch (StorageNotAvailableException $e) {
return new DataResponse([
'message' => $e->getMessage()
], Http::STATUS_SERVICE_UNAVAILABLE);
@@ -150,7 +152,7 @@ class ApiController extends Controller {
$shareTypesForNodes = $this->getShareTypesForNodes($nodes);
return array_values(array_map(function (Node $node) use ($shareTypesForNodes) {
$shareTypes = $shareTypesForNodes[$node->getId()] ?? [];
- $file = \OCA\Files\Helper::formatFileInfo($node->getFileInfo());
+ $file = Helper::formatFileInfo($node->getFileInfo());
$file['hasPreview'] = $this->previewManager->isAvailable($node);
$parts = explode('/', dirname($node->getPath()), 4);
if (isset($parts[3])) {
diff --git a/apps/files/lib/Controller/ViewController.php b/apps/files/lib/Controller/ViewController.php
index b5c61aaa5f4..b6aeb079add 100644
--- a/apps/files/lib/Controller/ViewController.php
+++ b/apps/files/lib/Controller/ViewController.php
@@ -8,6 +8,7 @@
namespace OCA\Files\Controller;
use OC\Files\FilenameValidator;
+use OC\Files\Filesystem;
use OCA\Files\AppInfo\Application;
use OCA\Files\Event\LoadAdditionalScriptsEvent;
use OCA\Files\Event\LoadSearchPlugins;
@@ -36,6 +37,7 @@ use OCP\IL10N;
use OCP\IRequest;
use OCP\IURLGenerator;
use OCP\IUserSession;
+use OCP\Util;
/**
* @package OCA\Files\Controller
@@ -69,7 +71,7 @@ class ViewController extends Controller {
* @throws \OCP\Files\NotFoundException
*/
protected function getStorageInfo(string $dir = '/') {
- $rootInfo = \OC\Files\Filesystem::getFileInfo('/', false);
+ $rootInfo = Filesystem::getFileInfo('/', false);
return \OC_Helper::getStorageInfo($dir, $rootInfo ?: null);
}
@@ -138,8 +140,8 @@ class ViewController extends Controller {
}
// Load the files we need
- \OCP\Util::addInitScript('files', 'init');
- \OCP\Util::addScript('files', 'main');
+ Util::addInitScript('files', 'init');
+ Util::addScript('files', 'main');
$userId = $this->userSession->getUser()->getUID();