Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion apps/dav/lib/Listener/CalendarDelegateActionListener.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
use OCP\Calendar\Events\CalendarObjectUpdatedEvent;
use OCP\EventDispatcher\Event;
use OCP\EventDispatcher\IEventListener;
use OCP\IL10N;
use OCP\IUser;
use OCP\IUserManager;
use OCP\IUserSession;
Expand Down Expand Up @@ -210,7 +211,7 @@ private function sendNotification(
/**
* @return array{0: string, 1: string} [subject, heading]
*/
private function subjectAndHeading(\OCP\IL10N $l, string $action, string $actorName, string $summary, string $calendarName): array {
private function subjectAndHeading(IL10N $l, string $action, string $actorName, string $summary, string $calendarName): array {
return match ($action) {
self::ACTION_CREATE => [
$l->t('%1$s created "%2$s" on your behalf', [$actorName, $summary]),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
use OCP\Activity\IManager;
use OCP\AppFramework\Http\JSONResponse;
use OCP\AppFramework\Services\IAppConfig;
use OCP\Authentication\Exceptions\WipeTokenException;
use OCP\IConfig;
use OCP\IL10N;
use OCP\IRequest;
Expand Down Expand Up @@ -243,7 +244,7 @@ public function testDestroyWipePendingEmitsCancelledSubject(): void {
$this->tokenProvider->expects($this->once())
->method('getTokenById')
->with($tokenId)
->willThrowException(new \OCP\Authentication\Exceptions\WipeTokenException($token));
->willThrowException(new WipeTokenException($token));

// The token is still invalidated (the user opted into cancelling the wipe).
$this->tokenProvider->expects($this->once())
Expand Down
33 changes: 17 additions & 16 deletions apps/user_ldap/tests/User_LDAPTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
use OCA\User_LDAP\User\User;
use OCA\User_LDAP\User_LDAP;
use OCA\User_LDAP\UserPluginManager;
use OCP\Accounts\IAccountManager;
use OCP\HintException;
use OCP\IConfig;
use OCP\IGroupManager;
Expand Down Expand Up @@ -1464,24 +1465,24 @@ public function testImplementsAction(string $configurable, string|int $value, in
public static function canEditPropertyProvider(): array {
return [
// Display name is always managed by LDAP
[\OCP\Accounts\IAccountManager::PROPERTY_DISPLAYNAME, '', false],
[\OCP\Accounts\IAccountManager::PROPERTY_DISPLAYNAME, 'cn', false],
[IAccountManager::PROPERTY_DISPLAYNAME, '', false],
[IAccountManager::PROPERTY_DISPLAYNAME, 'cn', false],
// Fields with no LDAP attribute configured are user-editable
[\OCP\Accounts\IAccountManager::PROPERTY_EMAIL, '', true],
[\OCP\Accounts\IAccountManager::PROPERTY_PHONE, '', true],
[\OCP\Accounts\IAccountManager::PROPERTY_WEBSITE, '', true],
[\OCP\Accounts\IAccountManager::PROPERTY_ADDRESS, '', true],
[\OCP\Accounts\IAccountManager::PROPERTY_FEDIVERSE, '', true],
[\OCP\Accounts\IAccountManager::PROPERTY_ORGANISATION, '', true],
[\OCP\Accounts\IAccountManager::PROPERTY_ROLE, '', true],
[\OCP\Accounts\IAccountManager::PROPERTY_HEADLINE, '', true],
[\OCP\Accounts\IAccountManager::PROPERTY_BIOGRAPHY, '', true],
[\OCP\Accounts\IAccountManager::PROPERTY_BIRTHDATE, '', true],
[\OCP\Accounts\IAccountManager::PROPERTY_PRONOUNS, '', true],
[IAccountManager::PROPERTY_EMAIL, '', true],
[IAccountManager::PROPERTY_PHONE, '', true],
[IAccountManager::PROPERTY_WEBSITE, '', true],
[IAccountManager::PROPERTY_ADDRESS, '', true],
[IAccountManager::PROPERTY_FEDIVERSE, '', true],
[IAccountManager::PROPERTY_ORGANISATION, '', true],
[IAccountManager::PROPERTY_ROLE, '', true],
[IAccountManager::PROPERTY_HEADLINE, '', true],
[IAccountManager::PROPERTY_BIOGRAPHY, '', true],
[IAccountManager::PROPERTY_BIRTHDATE, '', true],
[IAccountManager::PROPERTY_PRONOUNS, '', true],
// Fields with an LDAP attribute configured are managed by LDAP, not user-editable
[\OCP\Accounts\IAccountManager::PROPERTY_EMAIL, 'mail', false],
[\OCP\Accounts\IAccountManager::PROPERTY_PHONE, 'telephoneNumber', false],
[\OCP\Accounts\IAccountManager::PROPERTY_WEBSITE, 'labeledURI', false],
[IAccountManager::PROPERTY_EMAIL, 'mail', false],
[IAccountManager::PROPERTY_PHONE, 'telephoneNumber', false],
[IAccountManager::PROPERTY_WEBSITE, 'labeledURI', false],
];
}

Expand Down
2 changes: 1 addition & 1 deletion index.php
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ function resetStaticProperties(): void {
Filesystem::reset();
}

$handler = static function () {
$handler = static function (): void {
try {
resetStaticProperties();
OC::init();
Expand Down
3 changes: 2 additions & 1 deletion lib/private/Memcache/Memcached.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
namespace OC\Memcache;

use OCP\IMemcache;
use OCP\Server;

class Memcached extends Cache implements IMemcache {
use CASTrait;
Expand All @@ -19,7 +20,7 @@ class Memcached extends Cache implements IMemcache {

public function __construct($prefix = '') {
parent::__construct($prefix);
$this->cache = \OCP\Server::get(MemcachedFactory::class)->getInstance();
$this->cache = Server::get(MemcachedFactory::class)->getInstance();
}

/**
Expand Down
2 changes: 1 addition & 1 deletion lib/private/Memcache/Redis.php
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ public function __construct($prefix = '', string $logFile = '') {
*/
public function getCache(): \Redis|\RedisCluster {
if ($this->cache === null) {
$this->cache = \OCP\Server::get(RedisFactory::class)->getInstance();
$this->cache = Server::get(RedisFactory::class)->getInstance();
}
return $this->cache;
}
Expand Down
5 changes: 3 additions & 2 deletions lib/private/TaskProcessing/Manager.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
use OC\TaskProcessing\Db\TaskMapper;
use OCA\AppAPI\PublicFunctions;
use OCA\Guests\UserBackend;
use OCA\NotifyPush\Queue\IQueue;
use OCP\App\IAppManager;
use OCP\AppFramework\Db\DoesNotExistException;
use OCP\AppFramework\Db\MultipleObjectsReturnedException;
Expand Down Expand Up @@ -1193,7 +1194,7 @@ private function notifyTaskStatus(Task $task, int $status): void {
) {
try {
/** @psalm-suppress UndefinedClass */
$queue = Server::get(\OCA\NotifyPush\Queue\IQueue::class);
$queue = Server::get(IQueue::class);
/** @psalm-suppress UndefinedClass */
$queue->push('notify_custom', [
'user' => $userId,
Expand Down Expand Up @@ -1285,7 +1286,7 @@ public function setTaskIntermediateOutput(int $id, array $output): bool {
) {
try {
/** @psalm-suppress UndefinedClass */
$queue = Server::get(\OCA\NotifyPush\Queue\IQueue::class);
$queue = Server::get(IQueue::class);
/** @psalm-suppress UndefinedClass */
$queue->push('notify_custom', [
'user' => $userId,
Expand Down
2 changes: 1 addition & 1 deletion lib/private/legacy/OC_Util.php
Original file line number Diff line number Diff line change
Expand Up @@ -261,7 +261,7 @@ public static function addHeader($tag, $attributes, $text = null, $prepend = fal
* @return array arrays with error messages and hints
*/
public static function checkServer(SystemConfig $config) {
$l = \OCP\Server::get(IFactory::class)->get('lib');
$l = Server::get(IFactory::class)->get('lib');
$errors = [];
$CONFIG_DATADIRECTORY = $config->getValue('datadirectory', OC::$SERVERROOT . '/data');

Expand Down
4 changes: 2 additions & 2 deletions tests/Core/Command/User/LastSeenTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ public function testAllUsersWithoutExcludeDisabled(): void {

$this->userManager->expects($this->once())
->method('callForAllUsers')
->willReturnCallback(function ($callback) use ($enabledUser, $disabledUser) {
->willReturnCallback(function ($callback) use ($enabledUser, $disabledUser): void {
$callback($enabledUser);
$callback($disabledUser);
});
Expand Down Expand Up @@ -176,7 +176,7 @@ public function testAllUsersWithExcludeDisabled(): void {

$this->userManager->expects($this->once())
->method('callForAllUsers')
->willReturnCallback(function ($callback) use ($enabledUser, $disabledUser) {
->willReturnCallback(function ($callback) use ($enabledUser, $disabledUser): void {
$callback($enabledUser);
$callback($disabledUser);
});
Expand Down
2 changes: 2 additions & 0 deletions tests/lib/BackgroundJob/DummyJob.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<?php

declare(strict_types=1);

/**
* SPDX-FileCopyrightText: 2026 Nextcloud GmbH and Nextcloud contributors
* SPDX-License-Identifier: AGPL-3.0-or-later
Expand Down
3 changes: 2 additions & 1 deletion tests/lib/OCM/OCMSignatoryManagerJwksTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@

namespace Test\OCM;

use OC\Memcache\ArrayCache;
use OC\OCM\OCMSignatoryManager;
use OC\Security\IdentityProof\Manager as IdentityProofManager;
use OCP\Http\Client\IClient;
Expand Down Expand Up @@ -54,7 +55,7 @@ protected function setUp(): void {
$this->clientService->method('newClient')->willReturn($this->client);

$cacheFactory = $this->createMock(ICacheFactory::class);
$cacheFactory->method('createDistributed')->willReturn(new \OC\Memcache\ArrayCache(''));
$cacheFactory->method('createDistributed')->willReturn(new ArrayCache(''));

$this->signatoryManager = new OCMSignatoryManager(
$this->appConfig,
Expand Down
5 changes: 3 additions & 2 deletions tests/lib/OCM/OCMSignatoryManagerRotationTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@

namespace Test\OCM;

use OC\Memcache\ArrayCache;
use OC\OCM\OCMSignatoryManager;
use OC\Security\IdentityProof\Key;
use OC\Security\IdentityProof\Manager as IdentityProofManager;
Expand Down Expand Up @@ -50,7 +51,7 @@ protected function setUp(): void {
->willReturnCallback(static fn (string $suffix): string => 'https://alice.example/' . ltrim($suffix, '/'));

$cacheFactory = $this->createMock(ICacheFactory::class);
$cacheFactory->method('createDistributed')->willReturn(new \OC\Memcache\ArrayCache(''));
$cacheFactory->method('createDistributed')->willReturn(new ArrayCache(''));

$this->signatoryManager = new OCMSignatoryManager(
$this->appConfig,
Expand Down Expand Up @@ -194,7 +195,7 @@ public function testSignerReturnsNullWhenIdentityCannotBeDerived(): void {
->willThrowException(new IdentityNotFoundException('no url either'));

$cacheFactory = $this->createMock(ICacheFactory::class);
$cacheFactory->method('createDistributed')->willReturn(new \OC\Memcache\ArrayCache(''));
$cacheFactory->method('createDistributed')->willReturn(new ArrayCache(''));

$manager = new OCMSignatoryManager(
$this->appConfig,
Expand Down
Loading