aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--apps/dav/lib/CalDAV/ResourceBooking/AbstractPrincipalBackend.php12
-rw-r--r--apps/dav/lib/Connector/Sabre/Principal.php6
-rw-r--r--apps/dav/lib/Connector/Sabre/ServerFactory.php3
-rw-r--r--apps/dav/lib/Events/CalendarShareUpdatedEvent.php3
-rw-r--r--apps/dav/templates/settings-example-content.php2
-rw-r--r--apps/dav/tests/integration/DAV/Sharing/CalDavSharingBackendTest.php6
-rw-r--r--apps/dav/tests/unit/Connector/Sabre/DirectoryTest.php5
-rw-r--r--apps/files_sharing/lib/External/Scanner.php3
-rw-r--r--apps/files_trashbin/lib/Command/CleanUp.php3
-rw-r--r--apps/files_trashbin/lib/Command/Size.php9
-rw-r--r--apps/files_trashbin/tests/TrashbinTest.php3
-rw-r--r--apps/files_versions/lib/Listener/FileEventsListener.php3
-rw-r--r--apps/files_versions/tests/VersioningTest.php2
-rw-r--r--apps/settings/lib/Settings/Admin/Mail.php3
-rw-r--r--apps/settings/lib/Settings/Personal/PersonalInfo.php5
-rw-r--r--apps/user_ldap/lib/User/User.php2
16 files changed, 35 insertions, 35 deletions
diff --git a/apps/dav/lib/CalDAV/ResourceBooking/AbstractPrincipalBackend.php b/apps/dav/lib/CalDAV/ResourceBooking/AbstractPrincipalBackend.php
index e1bd2f5be29..236039e4890 100644
--- a/apps/dav/lib/CalDAV/ResourceBooking/AbstractPrincipalBackend.php
+++ b/apps/dav/lib/CalDAV/ResourceBooking/AbstractPrincipalBackend.php
@@ -25,12 +25,6 @@ use function array_values;
abstract class AbstractPrincipalBackend implements BackendInterface {
- /** @var ProxyMapper */
- private $proxyMapper;
-
- /** @var string */
- private $principalPrefix;
-
/** @var string */
private $dbTableName;
@@ -45,13 +39,11 @@ abstract class AbstractPrincipalBackend implements BackendInterface {
private IUserSession $userSession,
private IGroupManager $groupManager,
private LoggerInterface $logger,
- ProxyMapper $proxyMapper,
- string $principalPrefix,
+ private ProxyMapper $proxyMapper,
+ private string $principalPrefix,
string $dbPrefix,
private string $cuType,
) {
- $this->proxyMapper = $proxyMapper;
- $this->principalPrefix = $principalPrefix;
$this->dbTableName = 'calendar_' . $dbPrefix . 's';
$this->dbMetaDataTableName = $this->dbTableName . '_md';
$this->dbForeignKeyName = $dbPrefix . '_id';
diff --git a/apps/dav/lib/Connector/Sabre/Principal.php b/apps/dav/lib/Connector/Sabre/Principal.php
index 67edb1c4035..e49c61f6e1f 100644
--- a/apps/dav/lib/Connector/Sabre/Principal.php
+++ b/apps/dav/lib/Connector/Sabre/Principal.php
@@ -41,9 +41,6 @@ class Principal implements BackendInterface {
/** @var bool */
private $hasCircles;
- /** @var ProxyMapper */
- private $proxyMapper;
-
/** @var KnownUserService */
private $knownUserService;
@@ -54,7 +51,7 @@ class Principal implements BackendInterface {
private IShareManager $shareManager,
private IUserSession $userSession,
private IAppManager $appManager,
- ProxyMapper $proxyMapper,
+ private ProxyMapper $proxyMapper,
KnownUserService $knownUserService,
private IConfig $config,
private IFactory $languageFactory,
@@ -62,7 +59,6 @@ class Principal implements BackendInterface {
) {
$this->principalPrefix = trim($principalPrefix, '/');
$this->hasGroups = $this->hasCircles = ($principalPrefix === 'principals/users/');
- $this->proxyMapper = $proxyMapper;
$this->knownUserService = $knownUserService;
}
diff --git a/apps/dav/lib/Connector/Sabre/ServerFactory.php b/apps/dav/lib/Connector/Sabre/ServerFactory.php
index bdd13b7f44e..214412e1744 100644
--- a/apps/dav/lib/Connector/Sabre/ServerFactory.php
+++ b/apps/dav/lib/Connector/Sabre/ServerFactory.php
@@ -15,6 +15,7 @@ use OCA\DAV\CalDAV\Proxy\ProxyMapper;
use OCA\DAV\DAV\CustomPropertiesBackend;
use OCA\DAV\DAV\ViewOnlyPlugin;
use OCA\DAV\Files\BrowserErrorPagePlugin;
+use OCA\DAV\Files\Sharing\RootCollection;
use OCA\DAV\Upload\CleanupService;
use OCA\Theming\ThemingDefaults;
use OCP\Accounts\IAccountManager;
@@ -150,7 +151,7 @@ class ServerFactory {
);
// Mount the share collection at /public.php/dav/shares/<share token>
- $rootCollection->addChild(new \OCA\DAV\Files\Sharing\RootCollection(
+ $rootCollection->addChild(new RootCollection(
$root,
$userPrincipalBackend,
'principals/shares',
diff --git a/apps/dav/lib/Events/CalendarShareUpdatedEvent.php b/apps/dav/lib/Events/CalendarShareUpdatedEvent.php
index 2e49df956ec..0f8b23ad3ac 100644
--- a/apps/dav/lib/Events/CalendarShareUpdatedEvent.php
+++ b/apps/dav/lib/Events/CalendarShareUpdatedEvent.php
@@ -8,6 +8,7 @@ declare(strict_types=1);
*/
namespace OCA\DAV\Events;
+use OCA\DAV\CalDAV\CalDavBackend;
use OCP\EventDispatcher\Event;
/**
@@ -16,7 +17,7 @@ use OCP\EventDispatcher\Event;
* @package OCA\DAV\Events
* @since 20.0.0
*
- * @psalm-import-type CalendarInfo from \OCA\DAV\CalDAV\CalDavBackend
+ * @psalm-import-type CalendarInfo from CalDavBackend
*/
class CalendarShareUpdatedEvent extends Event {
/**
diff --git a/apps/dav/templates/settings-example-content.php b/apps/dav/templates/settings-example-content.php
index b2b051d745d..7c6f15bd82b 100644
--- a/apps/dav/templates/settings-example-content.php
+++ b/apps/dav/templates/settings-example-content.php
@@ -4,7 +4,7 @@
* SPDX-FileCopyrightText: 2025 Nextcloud GmbH and Nextcloud contributors
* SPDX-License-Identifier: AGPL-3.0-or-later
*/
-script('dav', 'settings-example-content');
+\OCP\Util::addScript('dav', 'settings-example-content', 'core');
?>
diff --git a/apps/dav/tests/integration/DAV/Sharing/CalDavSharingBackendTest.php b/apps/dav/tests/integration/DAV/Sharing/CalDavSharingBackendTest.php
index 407d9f9ba41..be06e8e4d4b 100644
--- a/apps/dav/tests/integration/DAV/Sharing/CalDavSharingBackendTest.php
+++ b/apps/dav/tests/integration/DAV/Sharing/CalDavSharingBackendTest.php
@@ -9,7 +9,9 @@ declare(strict_types=1);
namespace OCA\DAV\Tests\integration\DAV\Sharing;
+use OC\Memcache\NullCache;
use OCA\DAV\CalDAV\Calendar;
+use OCA\DAV\CalDAV\Sharing\Service;
use OCA\DAV\Connector\Sabre\Principal;
use OCA\DAV\DAV\Sharing\Backend;
use OCA\DAV\DAV\Sharing\SharingMapper;
@@ -50,11 +52,11 @@ class CalDavSharingBackendTest extends TestCase {
$this->principalBackend = $this->createMock(Principal::class);
$this->cacheFactory = $this->createMock(ICacheFactory::class);
$this->cacheFactory->method('createInMemory')
- ->willReturn(new \OC\Memcache\NullCache());
+ ->willReturn(new NullCache());
$this->logger = new \Psr\Log\NullLogger();
$this->sharingMapper = new SharingMapper($this->db);
- $this->sharingService = new \OCA\DAV\CalDAV\Sharing\Service($this->sharingMapper);
+ $this->sharingService = new Service($this->sharingMapper);
$this->sharingBackend = new \OCA\DAV\CalDAV\Sharing\Backend(
$this->userManager,
diff --git a/apps/dav/tests/unit/Connector/Sabre/DirectoryTest.php b/apps/dav/tests/unit/Connector/Sabre/DirectoryTest.php
index f6c19787e94..7fefe3e06da 100644
--- a/apps/dav/tests/unit/Connector/Sabre/DirectoryTest.php
+++ b/apps/dav/tests/unit/Connector/Sabre/DirectoryTest.php
@@ -15,6 +15,7 @@ use OC\Files\View;
use OCA\DAV\Connector\Sabre\Directory;
use OCA\DAV\Connector\Sabre\Exception\Forbidden;
use OCA\DAV\Connector\Sabre\Exception\InvalidPath;
+use OCA\Files_Sharing\External\Storage;
use OCP\Constants;
use OCP\Files\ForbiddenException;
use OCP\Files\InvalidPathException;
@@ -286,7 +287,7 @@ class DirectoryTest extends \Test\TestCase {
->willReturnMap([
['\OCA\Files_Sharing\SharedStorage', false],
['\OC\Files\Storage\Wrapper\Quota', false],
- [\OCA\Files_Sharing\External\Storage::class, false],
+ [Storage::class, false],
]);
$storage->expects($this->once())
@@ -342,7 +343,7 @@ class DirectoryTest extends \Test\TestCase {
->willReturnMap([
['\OCA\Files_Sharing\SharedStorage', false],
['\OC\Files\Storage\Wrapper\Quota', true],
- [\OCA\Files_Sharing\External\Storage::class, false],
+ [Storage::class, false],
]);
$storage->expects($this->once())
diff --git a/apps/files_sharing/lib/External/Scanner.php b/apps/files_sharing/lib/External/Scanner.php
index e45d3723923..2b0741b4b96 100644
--- a/apps/files_sharing/lib/External/Scanner.php
+++ b/apps/files_sharing/lib/External/Scanner.php
@@ -6,6 +6,7 @@
*/
namespace OCA\Files_Sharing\External;
+use OC\Files\Cache\CacheEntry;
use OC\ForbiddenException;
use OCP\Files\NotFoundException;
use OCP\Files\StorageInvalidException;
@@ -29,7 +30,7 @@ class Scanner extends \OC\Files\Cache\Scanner {
* @param string $file file to scan
* @param int $reuseExisting
* @param int $parentId
- * @param \OC\Files\Cache\CacheEntry|array|null|false $cacheData existing data in the cache for the file to be scanned
+ * @param CacheEntry|array|null|false $cacheData existing data in the cache for the file to be scanned
* @param bool $lock set to false to disable getting an additional read lock during scanning
* @param array|null $data the metadata for the file, as returned by the storage
* @return array|null an array of metadata of the scanned file
diff --git a/apps/files_trashbin/lib/Command/CleanUp.php b/apps/files_trashbin/lib/Command/CleanUp.php
index fc0157ec461..e9b4fa8ae60 100644
--- a/apps/files_trashbin/lib/Command/CleanUp.php
+++ b/apps/files_trashbin/lib/Command/CleanUp.php
@@ -11,6 +11,7 @@ use OCP\Files\IRootFolder;
use OCP\IDBConnection;
use OCP\IUserBackend;
use OCP\IUserManager;
+use OCP\Util;
use Symfony\Component\Console\Command\Command;
use Symfony\Component\Console\Exception\InvalidOptionException;
use Symfony\Component\Console\Input\InputArgument;
@@ -96,7 +97,7 @@ class CleanUp extends Command {
$node = $this->rootFolder->get($path);
if ($verbose) {
- $output->writeln('Deleting <info>' . \OCP\Util::humanFileSize($node->getSize()) . "</info> in trash for <info>$uid</info>.");
+ $output->writeln('Deleting <info>' . Util::humanFileSize($node->getSize()) . "</info> in trash for <info>$uid</info>.");
}
$node->delete();
if ($this->rootFolder->nodeExists($path)) {
diff --git a/apps/files_trashbin/lib/Command/Size.php b/apps/files_trashbin/lib/Command/Size.php
index 385872c436c..9c19d4d92b3 100644
--- a/apps/files_trashbin/lib/Command/Size.php
+++ b/apps/files_trashbin/lib/Command/Size.php
@@ -13,6 +13,7 @@ use OCP\Command\IBus;
use OCP\IConfig;
use OCP\IUser;
use OCP\IUserManager;
+use OCP\Util;
use Symfony\Component\Console\Input\InputArgument;
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Input\InputOption;
@@ -45,7 +46,7 @@ class Size extends Base {
$size = $input->getArgument('size');
if ($size) {
- $parsedSize = \OCP\Util::computerFileSize($size);
+ $parsedSize = Util::computerFileSize($size);
if ($parsedSize === false) {
$output->writeln('<error>Failed to parse input size</error>');
return -1;
@@ -70,7 +71,7 @@ class Size extends Base {
if ($globalSize < 0) {
$globalHumanSize = 'default (50% of available space)';
} else {
- $globalHumanSize = \OCP\Util::humanFileSize($globalSize);
+ $globalHumanSize = Util::humanFileSize($globalSize);
}
if ($user) {
@@ -79,7 +80,7 @@ class Size extends Base {
if ($userSize < 0) {
$userHumanSize = ($globalSize < 0) ? $globalHumanSize : "default($globalHumanSize)";
} else {
- $userHumanSize = \OCP\Util::humanFileSize($userSize);
+ $userHumanSize = Util::humanFileSize($userSize);
}
if ($input->getOption('output') == self::OUTPUT_FORMAT_PLAIN) {
@@ -106,7 +107,7 @@ class Size extends Base {
if (count($userValues)) {
$output->writeln('Per-user sizes:');
$this->writeArrayInOutputFormat($input, $output, array_map(function ($size) {
- return \OCP\Util::humanFileSize($size);
+ return Util::humanFileSize($size);
}, $userValues));
} else {
$output->writeln('No per-user sizes configured');
diff --git a/apps/files_trashbin/tests/TrashbinTest.php b/apps/files_trashbin/tests/TrashbinTest.php
index d16e90f74e9..823d69d02c5 100644
--- a/apps/files_trashbin/tests/TrashbinTest.php
+++ b/apps/files_trashbin/tests/TrashbinTest.php
@@ -12,6 +12,7 @@ use OC\Files\Filesystem;
use OC\Files\Storage\Local;
use OC\Files\View;
use OC\SystemConfig;
+use OC\User\Database;
use OCA\Files_Sharing\AppInfo\Application;
use OCA\Files_Trashbin\AppInfo\Application as TrashbinApplication;
use OCA\Files_Trashbin\Expiration;
@@ -59,7 +60,7 @@ class TrashbinTest extends \Test\TestCase {
// reset backend
Server::get(IUserManager::class)->clearBackends();
- Server::get(IUserManager::class)->registerBackend(new \OC\User\Database());
+ Server::get(IUserManager::class)->registerBackend(new Database());
// clear share hooks
\OC_Hook::clear('OCP\\Share');
diff --git a/apps/files_versions/lib/Listener/FileEventsListener.php b/apps/files_versions/lib/Listener/FileEventsListener.php
index d847c60ec64..a609f01f257 100644
--- a/apps/files_versions/lib/Listener/FileEventsListener.php
+++ b/apps/files_versions/lib/Listener/FileEventsListener.php
@@ -36,6 +36,7 @@ use OCP\Files\Folder;
use OCP\Files\IMimeTypeLoader;
use OCP\Files\IRootFolder;
use OCP\Files\Node;
+use OCP\Files\NotFoundException;
use OCP\IUserSession;
use Psr\Log\LoggerInterface;
@@ -378,7 +379,7 @@ class FileEventsListener implements IEventListener {
try {
$owner = $node->getOwner()?->getUid();
- } catch (\OCP\Files\NotFoundException) {
+ } catch (NotFoundException) {
$owner = null;
}
diff --git a/apps/files_versions/tests/VersioningTest.php b/apps/files_versions/tests/VersioningTest.php
index f294390a593..adfced9be91 100644
--- a/apps/files_versions/tests/VersioningTest.php
+++ b/apps/files_versions/tests/VersioningTest.php
@@ -808,7 +808,7 @@ class VersioningTest extends \Test\TestCase {
$eventDispatcher = Server::get(IEventDispatcher::class);
$eventFired = false;
- $eventDispatcher->addListener(VersionRestoredEvent::class, function ($event) use (&$eventFired, $t2) {
+ $eventDispatcher->addListener(VersionRestoredEvent::class, function ($event) use (&$eventFired, $t2): void {
$eventFired = true;
$this->assertEquals('/sub/test.txt', $event->getVersion()->getVersionPath());
$this->assertTrue($event->getVersion()->getRevisionId() > 0);
diff --git a/apps/settings/lib/Settings/Admin/Mail.php b/apps/settings/lib/Settings/Admin/Mail.php
index 728be01f3d8..566cdea310f 100644
--- a/apps/settings/lib/Settings/Admin/Mail.php
+++ b/apps/settings/lib/Settings/Admin/Mail.php
@@ -9,6 +9,7 @@ use OCP\AppFramework\Http\TemplateResponse;
use OCP\IBinaryFinder;
use OCP\IConfig;
use OCP\IL10N;
+use OCP\Server;
use OCP\Settings\IDelegatedSettings;
class Mail implements IDelegatedSettings {
@@ -26,7 +27,7 @@ class Mail implements IDelegatedSettings {
* @return TemplateResponse
*/
public function getForm() {
- $finder = \OCP\Server::get(IBinaryFinder::class);
+ $finder = Server::get(IBinaryFinder::class);
$parameters = [
// Mail
diff --git a/apps/settings/lib/Settings/Personal/PersonalInfo.php b/apps/settings/lib/Settings/Personal/PersonalInfo.php
index c8e9e732cd8..84b379f2e87 100644
--- a/apps/settings/lib/Settings/Personal/PersonalInfo.php
+++ b/apps/settings/lib/Settings/Personal/PersonalInfo.php
@@ -29,6 +29,7 @@ use OCP\L10N\IFactory;
use OCP\Notification\IManager;
use OCP\Server;
use OCP\Settings\ISettings;
+use OCP\Util;
class PersonalInfo implements ISettings {
@@ -71,7 +72,7 @@ class PersonalInfo implements ISettings {
if ($storageInfo['quota'] === FileInfo::SPACE_UNLIMITED) {
$totalSpace = $this->l->t('Unlimited');
} else {
- $totalSpace = \OCP\Util::humanFileSize($storageInfo['total']);
+ $totalSpace = Util::humanFileSize($storageInfo['total']);
}
$messageParameters = $this->getMessageParameters($account);
@@ -88,7 +89,7 @@ class PersonalInfo implements ISettings {
'groups' => $this->getGroups($user),
'quota' => $storageInfo['quota'],
'totalSpace' => $totalSpace,
- 'usage' => \OCP\Util::humanFileSize($storageInfo['used']),
+ 'usage' => Util::humanFileSize($storageInfo['used']),
'usageRelative' => round($storageInfo['relative']),
'displayName' => $this->getProperty($account, IAccountManager::PROPERTY_DISPLAYNAME),
'emailMap' => $this->getEmailMap($account),
diff --git a/apps/user_ldap/lib/User/User.php b/apps/user_ldap/lib/User/User.php
index 6d4af2d4ac5..1dff026e7d8 100644
--- a/apps/user_ldap/lib/User/User.php
+++ b/apps/user_ldap/lib/User/User.php
@@ -563,7 +563,7 @@ class User {
}
private function verifyQuotaValue(string $quotaValue): bool {
- return $quotaValue === 'none' || $quotaValue === 'default' || \OCP\Util::computerFileSize($quotaValue) !== false;
+ return $quotaValue === 'none' || $quotaValue === 'default' || Util::computerFileSize($quotaValue) !== false;
}
/**