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
4 changes: 2 additions & 2 deletions apps/dav/lib/AppInfo/PluginManager.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
use OCA\DAV\CalDAV\Integration\ICalendarProvider;
use OCA\DAV\CardDAV\Integration\IAddressBookProvider;
use OCP\App\IAppManager;
use OCP\AppFramework\QueryException;
use Psr\Container\ContainerExceptionInterface;
use Sabre\DAV\Collection;
use Sabre\DAV\ServerPlugin;
use function array_map;
Expand Down Expand Up @@ -229,7 +229,7 @@ private function extractCalendarPluginList(array $array): array {
private function createClass(string $className): object {
try {
return $this->container->get($className);
} catch (QueryException $e) {
} catch (ContainerExceptionInterface $e) {
if (class_exists($className)) {
return new $className();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@
namespace OCA\DAV\CalDAV\Reminder;

use OCA\DAV\CalDAV\Reminder\NotificationProvider\ProviderNotAvailableException;
use OCP\AppFramework\QueryException;
use OCP\Server;
use Psr\Container\ContainerExceptionInterface;

/**
* Class NotificationProviderManager
Expand Down Expand Up @@ -55,7 +55,7 @@ public function getProvider(string $type):INotificationProvider {
* Registers a new provider
*
* @param string $providerClassName
* @throws QueryException
* @throws ContainerExceptionInterface
*/
public function registerProvider(string $providerClassName):void {
$provider = Server::get($providerClassName);
Expand Down
3 changes: 1 addition & 2 deletions apps/dav/lib/CardDAV/UserAddressBooks.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
use OCA\DAV\CardDAV\Integration\IAddressBookProvider;
use OCA\DAV\ConfigLexicon;
use OCA\Federation\TrustedServers;
use OCP\AppFramework\QueryException;
use OCP\IAppConfig;
use OCP\IConfig;
use OCP\IGroupManager;
Expand Down Expand Up @@ -83,7 +82,7 @@ public function getChildren() {
try {
$trustedServers = Server::get(TrustedServers::class);
$request = Server::get(IRequest::class);
} catch (QueryException|NotFoundExceptionInterface|ContainerExceptionInterface $e) {
} catch (NotFoundExceptionInterface|ContainerExceptionInterface $e) {
// nothing to do, the request / trusted servers don't exist
}
if ($addressBook['principaluri'] === 'principals/system/system') {
Expand Down
6 changes: 3 additions & 3 deletions apps/dav/lib/Connector/Sabre/Principal.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@
use OCP\Accounts\IAccountProperty;
use OCP\Accounts\PropertyDoesNotExistException;
use OCP\App\IAppManager;
use OCP\AppFramework\QueryException;
use OCP\Constants;
use OCP\IConfig;
use OCP\IGroup;
Expand All @@ -27,6 +26,7 @@
use OCP\IUserSession;
use OCP\L10N\IFactory;
use OCP\Share\IManager as IShareManager;
use Psr\Container\ContainerExceptionInterface;
use Sabre\DAV\Exception;
use Sabre\DAV\PropPatch;
use Sabre\DAVACL\PrincipalBackend\BackendInterface;
Expand Down Expand Up @@ -539,7 +539,7 @@ protected function circleToPrincipal($circleUniqueId) {

try {
$circle = Circles::detailsCircle($circleUniqueId, true);
} catch (QueryException $ex) {
} catch (ContainerExceptionInterface $ex) {
return null;
} catch (CircleNotFoundException $ex) {
return null;
Expand All @@ -563,7 +563,7 @@ protected function circleToPrincipal($circleUniqueId) {
* @param string $principal
* @return array
* @throws Exception
* @throws QueryException
* @throws ContainerExceptionInterface
* @suppress PhanUndeclaredClassMethod
*/
public function getCircleMembership($principal):array {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,15 +14,15 @@
use OCA\DAV\CalDAV\Reminder\NotificationProviderManager;
use OCA\DAV\CalDAV\Reminder\NotificationTypeDoesNotExistException;
use OCA\DAV\Capabilities;
use OCP\AppFramework\QueryException;
use Psr\Container\ContainerExceptionInterface;
use Test\TestCase;

#[\PHPUnit\Framework\Attributes\Group('DB')]
class NotificationProviderManagerTest extends TestCase {
private NotificationProviderManager $providerManager;

/**
* @throws QueryException
* @throws ContainerExceptionInterface
*/
protected function setUp(): void {
parent::setUp();
Expand Down Expand Up @@ -65,7 +65,7 @@ public function testRegisterProvider(): void {
}

/**
* @throws QueryException
* @throws ContainerExceptionInterface
*/
public function testRegisterBadProvider(): void {
$this->expectException(\InvalidArgumentException::class);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,7 @@
class ResourceProvider implements IProvider {
public const RESOURCE_TYPE = 'file';

/** @var array */
protected $nodes = [];
protected array $nodes = [];

public function __construct(
protected IRootFolder $rootFolder,
Expand Down
4 changes: 2 additions & 2 deletions apps/files_external/lib/AppInfo/Application.php
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,6 @@
use OCP\AppFramework\Bootstrap\IBootContext;
use OCP\AppFramework\Bootstrap\IBootstrap;
use OCP\AppFramework\Bootstrap\IRegistrationContext;
use OCP\AppFramework\QueryException;
use OCP\Files\Config\IMountProviderCollection;
use OCP\Group\Events\BeforeGroupDeletedEvent;
use OCP\Group\Events\GroupDeletedEvent;
Expand All @@ -60,6 +59,7 @@
use OCP\User\Events\PostLoginEvent;
use OCP\User\Events\UserCreatedEvent;
use OCP\User\Events\UserDeletedEvent;
use Psr\Container\ContainerExceptionInterface;

/**
* @package OCA\Files_External\AppInfo
Expand All @@ -70,7 +70,7 @@ class Application extends App implements IBackendProvider, IAuthMechanismProvide
/**
* Application constructor.
*
* @throws QueryException
* @throws ContainerExceptionInterface
*/
public function __construct(array $urlParams = []) {
parent::__construct(self::APP_ID, $urlParams);
Expand Down
4 changes: 2 additions & 2 deletions apps/files_external/lib/Config/ConfigAdapter.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@
use OCA\Files_External\MountConfig;
use OCA\Files_External\Service\UserGlobalStoragesService;
use OCA\Files_External\Service\UserStoragesService;
use OCP\AppFramework\QueryException;
use OCP\Files\Config\IAuthoritativeMountProvider;
use OCP\Files\Config\IMountProvider;
use OCP\Files\Mount\IMountPoint;
Expand All @@ -28,6 +27,7 @@
use OCP\IUser;
use OCP\Server;
use Psr\Clock\ClockInterface;
use Psr\Container\ContainerExceptionInterface;
use Psr\Log\LoggerInterface;

/**
Expand Down Expand Up @@ -57,7 +57,7 @@ private function validateObjectStoreClassString(string $class): string {
/**
* Process storage ready for mounting
*
* @throws QueryException
* @throws ContainerExceptionInterface
*/
private function prepareStorageConfig(StorageConfig &$storage, IUser $user): void {
foreach ($storage->getBackendOptions() as $option => $value) {
Expand Down
4 changes: 2 additions & 2 deletions apps/files_external/lib/MountConfig.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,12 @@
use OCA\Files_External\Service\GlobalStoragesService;
use OCA\Files_External\Service\UserGlobalStoragesService;
use OCA\Files_External\Service\UserStoragesService;
use OCP\AppFramework\QueryException;
use OCP\Files\StorageNotAvailableException;
use OCP\IConfig;
use OCP\Security\ISecureRandom;
use OCP\Server;
use phpseclib\Crypt\AES;
use Psr\Container\ContainerExceptionInterface;
use Psr\Log\LoggerInterface;

/**
Expand Down Expand Up @@ -48,7 +48,7 @@ public function __construct(
* @param mixed $input
* @param string|null $userId
* @return mixed
* @throws QueryException
* @throws ContainerExceptionInterface
* @since 16.0.0
*/
public static function substitutePlaceholdersInConfig($input, ?string $userId = null) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -181,10 +181,10 @@ public function undelete(string $id): DataResponse {
* Returns the helper of DeletedShareAPIController for room shares.
*
* If the Talk application is not enabled or the helper is not available
* a QueryException is thrown instead.
* a ContainerExceptionInterface is thrown instead.
*
* @psalm-suppress UndefinedClass
* @throws QueryException
* @throws ContainerExceptionInterface
*/
private function getRoomShareHelper(): \OCA\Talk\Share\Helper\DeletedShareAPIController {
if (!$this->appManager->isEnabledForUser('spreed')) {
Expand All @@ -199,10 +199,10 @@ private function getRoomShareHelper(): \OCA\Talk\Share\Helper\DeletedShareAPICon
* Returns the helper of DeletedShareAPIHelper for deck shares.
*
* If the Deck application is not enabled or the helper is not available
* a QueryException is thrown instead.
* a ContainerExceptionInterface is thrown instead.
*
* @psalm-suppress UndefinedClass
* @throws QueryException
* @throws ContainerExceptionInterface
*/
private function getDeckShareHelper(): \OCA\Deck\Sharing\ShareAPIHelper {
if (!$this->appManager->isEnabledForUser('deck')) {
Expand Down
3 changes: 2 additions & 1 deletion lib/public/AppFramework/App.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
use OC\ServerContainer;
use OCP\IConfig;
use OCP\Server;
use Psr\Container\ContainerExceptionInterface;
use Psr\Log\LoggerInterface;

/**
Expand Down Expand Up @@ -90,7 +91,7 @@ public function __construct(string $appName, array $urlParams = []) {

try {
$this->container = \OC::$server->getRegisteredAppContainer($appName);
} catch (QueryException $e) {
} catch (ContainerExceptionInterface $e) {
$this->container = new \OC\AppFramework\DependencyInjection\DIContainer($appName, $urlParams);
}
}
Expand Down
3 changes: 0 additions & 3 deletions lib/public/IContainer.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
namespace OCP;

use Closure;
use OCP\AppFramework\QueryException;
use Psr\Container\ContainerExceptionInterface;
use Psr\Container\ContainerInterface;
use Psr\Container\NotFoundExceptionInterface;
Expand All @@ -37,7 +36,6 @@ interface IContainer extends ContainerInterface {
* @since 8.2.0
* @deprecated 20.0.0 use \Psr\Container\ContainerInterface::get
* @throws ContainerExceptionInterface if the class could not be found or instantiated
* @throws QueryException if the class could not be found or instantiated
*/
public function resolve($name);

Expand All @@ -53,7 +51,6 @@ public function resolve($name);
* @psalm-return ($name is class-string ? T : mixed)
* @throws ContainerExceptionInterface if the query could not be resolved
* @throws NotFoundExceptionInterface if the name could not be found within the container
* @throws QueryException if the query could not be resolved
* @since 6.0.0
* @deprecated 20.0.0 use \Psr\Container\ContainerInterface::get
*/
Expand Down
9 changes: 5 additions & 4 deletions lib/public/Log/functions.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@
namespace OCP\Log;

use OC;
use OCP\AppFramework\QueryException;
use OCP\Server;
use Psr\Container\ContainerExceptionInterface;
use Psr\Log\LoggerInterface;
use Psr\Log\NullLogger;
use function class_exists;
Expand Down Expand Up @@ -45,14 +46,14 @@ function logger(?string $appId = null): LoggerInterface {
try {
$appContainer = OC::$server->getRegisteredAppContainer($appId);
return $appContainer->get(LoggerInterface::class);
} catch (QueryException $e) {
} catch (ContainerExceptionInterface $e) {
// Ignore and return the server logger below
}
}

try {
return OC::$server->get(LoggerInterface::class);
} catch (QueryException $e) {
return Server::get(LoggerInterface::class);
} catch (ContainerExceptionInterface $e) {
return new NullLogger();
}
}
Loading