]> source.dussan.org Git - nextcloud-server.git/commitdiff
Migrate HintException to OCP 26681/head
authorGary Kim <gary@garykim.dev>
Tue, 29 Jun 2021 23:20:33 +0000 (19:20 -0400)
committerGary Kim <gary@garykim.dev>
Wed, 30 Jun 2021 19:28:02 +0000 (15:28 -0400)
Signed-off-by: Gary Kim <gary@garykim.dev>
60 files changed:
apps/encryption/lib/Command/FixEncryptedVersion.php
apps/federatedfilesharing/lib/AddressHandler.php
apps/federatedfilesharing/lib/Controller/MountPublicLinkController.php
apps/federatedfilesharing/lib/Controller/RequestHandlerController.php
apps/federatedfilesharing/lib/FederatedShareProvider.php
apps/federatedfilesharing/lib/Notifications.php
apps/federatedfilesharing/lib/Notifier.php
apps/federatedfilesharing/lib/OCM/CloudFederationProviderFiles.php
apps/federatedfilesharing/tests/AddressHandlerTest.php
apps/federatedfilesharing/tests/Controller/MountPublicLinkControllerTest.php
apps/federation/lib/Controller/SettingsController.php
apps/federation/lib/DbHandler.php
apps/federation/lib/Middleware/AddServerMiddleware.php
apps/federation/lib/TrustedServers.php
apps/federation/tests/Controller/SettingsControllerTest.php
apps/federation/tests/Middleware/AddServerMiddlewareTest.php
apps/federation/tests/TrustedServersTest.php
apps/files_sharing/lib/Controller/ShareController.php
apps/provisioning_api/lib/Controller/UsersController.php
apps/settings/lib/Controller/ChangePasswordController.php
apps/sharebymail/lib/ShareByMailProvider.php
apps/sharebymail/tests/ShareByMailProviderTest.php
apps/user_ldap/lib/Access.php
apps/user_ldap/lib/Controller/RenewPasswordController.php
apps/user_ldap/tests/AccessTest.php
apps/user_ldap/tests/User_LDAPTest.php
core/Controller/LostController.php
index.php
lib/base.php
lib/composer/composer/autoload_classmap.php
lib/composer/composer/autoload_static.php
lib/private/AppFramework/App.php
lib/private/Config.php
lib/private/DatabaseSetupException.php
lib/private/HintException.php
lib/private/Installer.php
lib/private/Log/ExceptionSerializer.php
lib/private/Log/Systemdlog.php
lib/private/Memcache/Factory.php
lib/private/Memcache/Memcached.php
lib/private/Setup.php
lib/private/Share20/Manager.php
lib/private/Updater.php
lib/private/User/Manager.php
lib/private/legacy/OC_Hook.php
lib/private/legacy/OC_Util.php
lib/public/Encryption/Exceptions/GenericEncryptionException.php
lib/public/Federation/Exceptions/ActionNotSupportedException.php
lib/public/Federation/Exceptions/AuthenticationFailedException.php
lib/public/Federation/Exceptions/BadRequestException.php
lib/public/Federation/Exceptions/ProviderAlreadyExistsException.php
lib/public/Federation/Exceptions/ProviderCouldNotAddShareException.php
lib/public/Federation/Exceptions/ProviderDoesNotExistsException.php
lib/public/Files/StorageNotAvailableException.php
lib/public/HintException.php [new file with mode: 0644]
lib/public/Share/Exceptions/GenericShareException.php
tests/Core/Controller/ChangePasswordControllerTest.php
tests/lib/Memcache/FactoryTest.php
tests/lib/Share20/ManagerTest.php
tests/lib/User/DatabaseTest.php

index a85a96258fcf409fc0d50081653fac33f63eb380..da8a69cf464d2ab671ea281387ba4d715bba6c85 100644 (file)
@@ -23,9 +23,9 @@
 namespace OCA\Encryption\Command;
 
 use OC\Files\View;
-use OC\HintException;
 use OCA\Encryption\Util;
 use OCP\Files\IRootFolder;
+use OCP\HintException;
 use OCP\IConfig;
 use OCP\ILogger;
 use OCP\IUserManager;
index 5b50be2a53a525f673a41909eec1dabd1f9ad646..d76ff9518b6369f484ffd9738cd74a8a31840d42 100644 (file)
@@ -25,8 +25,8 @@
  */
 namespace OCA\FederatedFileSharing;
 
-use OC\HintException;
 use OCP\Federation\ICloudIdManager;
+use OCP\HintException;
 use OCP\IL10N;
 use OCP\IURLGenerator;
 
index 6e66e7f9b4a49ef174ac690cf5d9bf388690e6d7..404077e46affe510de938cd9f4c14d8a0553a9cd 100644 (file)
@@ -31,7 +31,6 @@
  */
 namespace OCA\FederatedFileSharing\Controller;
 
-use OC\HintException;
 use OCA\FederatedFileSharing\AddressHandler;
 use OCA\FederatedFileSharing\FederatedShareProvider;
 use OCP\AppFramework\Controller;
@@ -39,6 +38,7 @@ use OCP\AppFramework\Http;
 use OCP\AppFramework\Http\JSONResponse;
 use OCP\Constants;
 use OCP\Federation\ICloudIdManager;
+use OCP\HintException;
 use OCP\Http\Client\IClientService;
 use OCP\IL10N;
 use OCP\ILogger;
index 99adefde000be77fcabd1fe9b3cce65793126868..f19e251fc7af779e94397396bf60369111dc7a80 100644 (file)
@@ -230,7 +230,7 @@ class RequestHandlerController extends OCSController {
         * @return Http\DataResponse
         * @throws OCSException
         * @throws ShareNotFound
-        * @throws \OC\HintException
+        * @throws \OCP\HintException
         */
        public function acceptShare($id) {
                $token = isset($_POST['token']) ? $_POST['token'] : null;
index d5fa99ef2319f7a693f91c6636706816380d3f8a..52b10cd9315f3271291c6dcdfd0783a59cede5ef 100644 (file)
@@ -441,7 +441,7 @@ class FederatedShareProvider implements IShareProvider {
         *
         * @param IShare $share
         * @throws ShareNotFound
-        * @throws \OC\HintException
+        * @throws \OCP\HintException
         */
        protected function sendPermissionUpdate(IShare $share) {
                $remoteId = $this->getRemoteId($share);
@@ -550,7 +550,7 @@ class FederatedShareProvider implements IShareProvider {
         *
         * @param IShare $share
         * @throws ShareNotFound
-        * @throws \OC\HintException
+        * @throws \OCP\HintException
         */
        public function delete(IShare $share) {
                [, $remote] = $this->addressHandler->splitUserRemote($share->getSharedWith());
@@ -577,7 +577,7 @@ class FederatedShareProvider implements IShareProvider {
         * @param IShare $share
         * @param bool $isOwner the user can either be the owner or the user who re-sahred it
         * @throws ShareNotFound
-        * @throws \OC\HintException
+        * @throws \OCP\HintException
         */
        protected function revokeShare($share, $isOwner) {
                if ($this->userManager->userExists($share->getShareOwner()) && $this->userManager->userExists($share->getSharedBy())) {
index c72a0691fad0be30f43398eaa74c41037b154ee7..2a162abcd76ba9865e05435bfe86a832beedcbca 100644 (file)
@@ -34,8 +34,8 @@ use OCP\EventDispatcher\IEventDispatcher;
 use OCP\Federation\ICloudFederationFactory;
 use OCP\Federation\ICloudFederationProviderManager;
 use OCP\Http\Client\IClientService;
-use OCP\OCS\IDiscoveryService;
 use OCP\ILogger;
+use OCP\OCS\IDiscoveryService;
 
 class Notifications {
        public const RESPONSE_FORMAT = 'json'; // default response format for ocs calls
@@ -97,7 +97,7 @@ class Notifications {
         * @param string $sharedByFederatedId
         * @param int $shareType (can be a remote user or group share)
         * @return bool
-        * @throws \OC\HintException
+        * @throws \OCP\HintException
         * @throws \OC\ServerNotAvailableException
         */
        public function sendRemoteShare($token, $shareWith, $name, $remoteId, $owner, $ownerFederatedId, $sharedBy, $sharedByFederatedId, $shareType) {
@@ -156,7 +156,7 @@ class Notifications {
         * @param int $permission
         * @param string $filename
         * @return array|false
-        * @throws \OC\HintException
+        * @throws \OCP\HintException
         * @throws \OC\ServerNotAvailableException
         */
        public function requestReShare($token, $id, $shareId, $remote, $shareWith, $permission, $filename) {
index a551a3cca0c89cb2e24d5d3f878c65591a9892e8..fa0119010cf91c7fe2b68d4200c26fecff619d9c 100644 (file)
  */
 namespace OCA\FederatedFileSharing;
 
-use OC\HintException;
 use OCP\Contacts\IManager;
 use OCP\Federation\ICloudId;
 use OCP\Federation\ICloudIdManager;
+use OCP\HintException;
 use OCP\IURLGenerator;
 use OCP\L10N\IFactory;
 use OCP\Notification\INotification;
index 26b0288c35443e5f290a265e98613f07f8ae430c..cc6b260add6e1aa6199f8ec863ef2b1fda603c4f 100644 (file)
@@ -30,7 +30,6 @@ namespace OCA\FederatedFileSharing\OCM;
 
 use OC\AppFramework\Http;
 use OC\Files\Filesystem;
-use OC\HintException;
 use OCA\FederatedFileSharing\AddressHandler;
 use OCA\FederatedFileSharing\FederatedShareProvider;
 use OCA\Files_Sharing\Activity\Providers\RemoteShares;
@@ -48,6 +47,7 @@ use OCP\Federation\ICloudFederationProviderManager;
 use OCP\Federation\ICloudFederationShare;
 use OCP\Federation\ICloudIdManager;
 use OCP\Files\NotFoundException;
+use OCP\HintException;
 use OCP\IConfig;
 use OCP\IDBConnection;
 use OCP\IGroupManager;
@@ -55,7 +55,6 @@ use OCP\ILogger;
 use OCP\IURLGenerator;
 use OCP\IUserManager;
 use OCP\Notification\IManager as INotificationManager;
-use OCP\Share;
 use OCP\Share\Exceptions\ShareNotFound;
 use OCP\Share\IManager;
 use OCP\Share\IShare;
@@ -176,7 +175,7 @@ class CloudFederationProviderFiles implements ICloudFederationProvider {
         *
         * @throws ProviderCouldNotAddShareException
         * @throws \OCP\AppFramework\QueryException
-        * @throws \OC\HintException
+        * @throws HintException
         * @since 14.0.0
         */
        public function shareReceived(ICloudFederationShare $share) {
@@ -305,7 +304,7 @@ class CloudFederationProviderFiles implements ICloudFederationProvider {
         * @throws ActionNotSupportedException
         * @throws AuthenticationFailedException
         * @throws BadRequestException
-        * @throws \OC\HintException
+        * @throws HintException
         * @since 14.0.0
         */
        public function notificationReceived($notificationType, $providerId, array $notification) {
@@ -373,7 +372,7 @@ class CloudFederationProviderFiles implements ICloudFederationProvider {
         * @throws ActionNotSupportedException
         * @throws AuthenticationFailedException
         * @throws BadRequestException
-        * @throws \OC\HintException
+        * @throws HintException
         */
        private function shareAccepted($id, array $notification) {
                if (!$this->isS2SEnabled()) {
@@ -442,7 +441,7 @@ class CloudFederationProviderFiles implements ICloudFederationProvider {
         * @throws AuthenticationFailedException
         * @throws BadRequestException
         * @throws ShareNotFound
-        * @throws \OC\HintException
+        * @throws HintException
         *
         */
        protected function shareDeclined($id, array $notification) {
index d1d4f9cd70e8eb933822d3b8b63fa5ff4223317d..f21d29ebd7ef6a90ddcc3404d1d324874d6ff086 100644 (file)
@@ -136,7 +136,7 @@ class AddressHandlerTest extends \Test\TestCase {
         * @param string $id
         */
        public function testSplitUserRemoteError($id) {
-               $this->expectException(\OC\HintException::class);
+               $this->expectException(\OCP\HintException::class);
 
                $this->addressHandler->splitUserRemote($id);
        }
index 385f644f6b4a88566e0ee54b0877098afbc5c9b4..d3a87a4c4160ce0bc8081d126bb4f963a1f24dbe 100644 (file)
@@ -29,7 +29,6 @@
 namespace OCA\FederatedFileSharing\Tests\Controller;
 
 use OC\Federation\CloudIdManager;
-use OC\HintException;
 use OCA\FederatedFileSharing\AddressHandler;
 use OCA\FederatedFileSharing\Controller\MountPublicLinkController;
 use OCA\FederatedFileSharing\FederatedShareProvider;
@@ -37,6 +36,7 @@ use OCP\AppFramework\Http;
 use OCP\Contacts\IManager as IContactsManager;
 use OCP\Federation\ICloudIdManager;
 use OCP\Files\IRootFolder;
+use OCP\HintException;
 use OCP\Http\Client\IClientService;
 use OCP\IL10N;
 use OCP\IRequest;
index 86c1df89caf1794abd9578570e03609ce5293acb..970211e41038c58c38b1fa565f8725a69a97c3dd 100644 (file)
  */
 namespace OCA\Federation\Controller;
 
-use OC\HintException;
 use OCA\Federation\TrustedServers;
 use OCP\AppFramework\Controller;
 use OCP\AppFramework\Http\DataResponse;
+use OCP\HintException;
 use OCP\IL10N;
 use OCP\IRequest;
 
index ce4d1d7e44a0146c64b04a885f518d778835e45e..1dd0d1fc1c4a347a2fc02b7400df2a02ed1c0030 100644 (file)
@@ -28,7 +28,7 @@
 namespace OCA\Federation;
 
 use OC\Files\Filesystem;
-use OC\HintException;
+use OCP\HintException;
 use OCP\IDBConnection;
 use OCP\IL10N;
 
index 2cfdad133ca064e1b5fad73019a6990812835d24..de6f7786679acc694e202d56f11d636a767556e1 100644 (file)
  */
 namespace OCA\Federation\Middleware;
 
-use OC\HintException;
 use OCA\Federation\Controller\SettingsController;
 use OCP\AppFramework\Controller;
 use OCP\AppFramework\Http;
 use OCP\AppFramework\Http\JSONResponse;
 use OCP\AppFramework\Middleware;
+use OCP\HintException;
 use OCP\IL10N;
 use OCP\ILogger;
 
index c1dced62102ed9f3b14c742040d5b422525a1959..57b9a505499370c6ef770c008b41e4585fb93a96 100644 (file)
  */
 namespace OCA\Federation;
 
-use OC\HintException;
 use OCA\Federation\BackgroundJob\RequestSharedSecret;
 use OCP\AppFramework\Http;
 use OCP\AppFramework\Utility\ITimeFactory;
 use OCP\BackgroundJob\IJobList;
+use OCP\HintException;
 use OCP\Http\Client\IClientService;
 use OCP\IConfig;
 use OCP\ILogger;
index 1f3617de389c3df79ea76c116ebf487830ffc395..856dcaa533f1bc994ea847b20a3f4e69ea4f2558 100644 (file)
@@ -88,7 +88,7 @@ class SettingsControllerTest extends TestCase {
         * @param bool $isOwnCloud
         */
        public function testAddServerFail($isTrustedServer, $isOwnCloud) {
-               $this->expectException(\OC\HintException::class);
+               $this->expectException(\OCP\HintException::class);
 
                $this->trustedServers
                        ->expects($this->any())
@@ -136,7 +136,7 @@ class SettingsControllerTest extends TestCase {
         * @param bool $isOwnCloud
         */
        public function testCheckServerFail($isTrustedServer, $isOwnCloud) {
-               $this->expectException(\OC\HintException::class);
+               $this->expectException(\OCP\HintException::class);
 
                $this->trustedServers
                        ->expects($this->any())
index fdd9d1682d4c9c80a6ca6f6eaf31917013c9d699..c3370cdbe90967d1f2ca45d5d46b5163678e6209 100644 (file)
  */
 namespace OCA\Federation\Tests\Middleware;
 
-use OC\HintException;
 use OCA\Federation\Controller\SettingsController;
 use OCA\Federation\Middleware\AddServerMiddleware;
 use OCP\AppFramework\Http;
+use OCP\HintException;
 use OCP\IL10N;
 use OCP\ILogger;
 use Test\TestCase;
index 3dd237ffcd31bdaf0ba7985f598aeaa58d0ac9aa..3dd93a445cdc285028ee9526a607f5be968cf4f3 100644 (file)
@@ -311,7 +311,7 @@ class TrustedServersTest extends TestCase {
         * @dataProvider dataTestCheckOwnCloudVersionTooLow
         */
        public function testCheckOwnCloudVersionTooLow($status) {
-               $this->expectException(\OC\HintException::class);
+               $this->expectException(\OCP\HintException::class);
                $this->expectExceptionMessage('Remote server version is too low. 9.0 is required.');
 
                $this->invokePrivate($this->trustedServers, 'checkOwnCloudVersion', [$status]);
index fbee6bf4b77f5e5b7a9ad9a132f0ed88f83c08e7..95c3303ae74b0fac78d89fccabea5e72b90bf75d 100644 (file)
@@ -42,9 +42,9 @@
  */
 namespace OCA\Files_Sharing\Controller;
 
+use OC\Security\CSP\ContentSecurityPolicy;
 use OC_Files;
 use OC_Util;
-use OC\Security\CSP\ContentSecurityPolicy;
 use OCA\FederatedFileSharing\FederatedShareProvider;
 use OCA\Files_Sharing\Activity\Providers\Downloads;
 use OCA\Files_Sharing\Event\BeforeTemplateRenderedEvent;
@@ -242,7 +242,7 @@ class ShareController extends AuthPublicShareController {
         * otherwise token
         * @param int $errorCode
         * @param string $errorMessage
-        * @throws \OC\HintException
+        * @throws \OCP\HintException
         * @throws \OC\ServerNotAvailableException
         */
        protected function emitAccessShareHook($share, $errorCode = 200, $errorMessage = '') {
index d94e8fed8a8a9b8576cd2104761e7f89375e7977..01e4bac9c2b11a95efcada2e3365fd3eac973bb5 100644 (file)
@@ -47,7 +47,6 @@ use libphonenumber\PhoneNumber;
 use libphonenumber\PhoneNumberFormat;
 use libphonenumber\PhoneNumberUtil;
 use OC\Authentication\Token\RemoteWipe;
-use OC\HintException;
 use OC\KnownUser\KnownUserService;
 use OC\User\Backend;
 use OCA\Settings\Mailer\NewUserMailHelper;
@@ -59,6 +58,8 @@ use OCP\AppFramework\Http\DataResponse;
 use OCP\AppFramework\OCS\OCSException;
 use OCP\AppFramework\OCS\OCSForbiddenException;
 use OCP\AppFramework\OCSController;
+use OCP\EventDispatcher\IEventDispatcher;
+use OCP\HintException;
 use OCP\IConfig;
 use OCP\IGroup;
 use OCP\IGroupManager;
@@ -68,9 +69,8 @@ use OCP\IUser;
 use OCP\IUserManager;
 use OCP\IUserSession;
 use OCP\L10N\IFactory;
-use OCP\Security\ISecureRandom;
 use OCP\Security\Events\GenerateSecurePasswordEvent;
-use OCP\EventDispatcher\IEventDispatcher;
+use OCP\Security\ISecureRandom;
 use OCP\User\Backend\ISetDisplayNameBackend;
 use Psr\Log\LoggerInterface;
 
index 76ac2f792ac1480f3cca0c616c8a5db9c6f9f9eb..8dd1e6ba02840ea2dba22a8fb29610f7c816ae04 100644 (file)
 namespace OCA\Settings\Controller;
 
 use OC\Group\Manager as GroupManager;
-use OC\HintException;
 use OC\User\Session;
 use OCP\App\IAppManager;
 use OCP\AppFramework\Controller;
 use OCP\AppFramework\Http\JSONResponse;
+use OCP\HintException;
 use OCP\IGroupManager;
 use OCP\IL10N;
 use OCP\IRequest;
index b5226850fa45d29ba36e09619b36eb0fad2e6de3..74e78c48d86c314f12b84ab9776be7f608f93498 100644 (file)
@@ -40,7 +40,6 @@
  */
 namespace OCA\ShareByMail;
 
-use OC\HintException;
 use OC\Share20\Exception\InvalidShare;
 use OC\Share20\Share;
 use OC\User\NoUserException;
@@ -52,6 +51,7 @@ use OCP\EventDispatcher\IEventDispatcher;
 use OCP\Files\Folder;
 use OCP\Files\IRootFolder;
 use OCP\Files\Node;
+use OCP\HintException;
 use OCP\IDBConnection;
 use OCP\IL10N;
 use OCP\ILogger;
index 9c3b6525736f33bea07b4367068deb3d20a5d51c..64d81aab2544a083f92fd1b3a7dad32669f69dd0 100644 (file)
@@ -479,7 +479,7 @@ class ShareByMailProviderTest extends TestCase {
 
 
        public function testCreateMailShareFailed() {
-               $this->expectException(\OC\HintException::class);
+               $this->expectException(\OCP\HintException::class);
 
                $this->share->expects($this->any())->method('getToken')->willReturn('token');
                $this->share->expects($this->once())->method('setToken')->with('token');
index 47cecd1bf7d1f7a88cb1d0e4c1bb286bd7993b4a..33329c0f03ab3cf0cc58cb238110cdd596a360c0 100644 (file)
@@ -47,7 +47,6 @@
 namespace OCA\User_LDAP;
 
 use DomainException;
-use OC\HintException;
 use OC\Hooks\PublicEmitter;
 use OC\ServerNotAvailableException;
 use OCA\User_LDAP\Exceptions\ConstraintViolationException;
@@ -56,6 +55,7 @@ use OCA\User_LDAP\Mapping\AbstractMapping;
 use OCA\User_LDAP\Mapping\UserMapping;
 use OCA\User_LDAP\User\Manager;
 use OCA\User_LDAP\User\OfflineUser;
+use OCP\HintException;
 use OCP\IConfig;
 use OCP\ILogger;
 use OCP\IUserManager;
index eb8b19192c33083d090fe9d25a7344235d3889a0..66371cb3b496a848290bb7c653ae1584d1e65d3b 100644 (file)
  */
 namespace OCA\User_LDAP\Controller;
 
-use OC\HintException;
 use OCP\AppFramework\Controller;
 use OCP\AppFramework\Http\RedirectResponse;
 use OCP\AppFramework\Http\TemplateResponse;
+use OCP\HintException;
 use OCP\IConfig;
 use OCP\IL10N;
 use OCP\IRequest;
@@ -139,7 +139,7 @@ class RenewPasswordController extends Controller {
                        ]);
                        return new RedirectResponse($this->urlGenerator->linkToRoute('user_ldap.renewPassword.showRenewPasswordForm', $args));
                }
-               
+
                try {
                        if (!is_null($newPassword) && \OC_User::setPassword($user, $newPassword)) {
                                $this->session->set('loginMessages', [
index ae07ea509ef7a5f9393bedb33fa078a3e7cb1bf4..e49faca70cce802a0e27175a0190ff55913b9c93 100644 (file)
@@ -482,7 +482,7 @@ class AccessTest extends TestCase {
 
 
        public function testSetPasswordWithRejectedChange() {
-               $this->expectException(\OC\HintException::class);
+               $this->expectException(\OCP\HintException::class);
                $this->expectExceptionMessage('Password change rejected.');
 
                $this->connection
index 78767ff6760d7a513224b423ae5d0a154503b735..3142a256c9a133fc61f1cea14ca4b3e08fe9bc42 100644 (file)
@@ -31,7 +31,6 @@
  */
 namespace OCA\User_LDAP\Tests;
 
-use OC\HintException;
 use OC\User\Backend;
 use OC\User\Session;
 use OCA\User_LDAP\Access;
@@ -44,6 +43,7 @@ use OCA\User_LDAP\User\User;
 use OCA\User_LDAP\User_LDAP;
 use OCA\User_LDAP\User_LDAP as UserLDAP;
 use OCA\User_LDAP\UserPluginManager;
+use OCP\HintException;
 use OCP\IConfig;
 use OCP\IUser;
 use OCP\Notification\IManager as INotificationManager;
@@ -1214,7 +1214,7 @@ class User_LDAPTest extends TestCase {
 
 
        public function testSetPasswordInvalid() {
-               $this->expectException(\OC\HintException::class);
+               $this->expectException(\OCP\HintException::class);
                $this->expectExceptionMessage('Password fails quality checking policy');
 
                $this->prepareAccessForSetPassword($this->access);
@@ -1359,7 +1359,7 @@ class User_LDAPTest extends TestCase {
 
 
        public function testSetDisplayNameErrorWithPlugin() {
-               $this->expectException(\OC\HintException::class);
+               $this->expectException(\OCP\HintException::class);
 
                $newDisplayName = 'J. Baker';
                $this->pluginManager->expects($this->once())
index 99427132f5e44ed38eb3b2d76e935ace887a232c..bed96eeec8308d68d6f994c6e2b015043723c775 100644 (file)
  */
 namespace OC\Core\Controller;
 
-use function array_filter;
-use function count;
 use OC\Authentication\TwoFactorAuth\Manager;
 use OC\Core\Exception\ResetPasswordException;
-use OC\HintException;
 use OCP\AppFramework\Controller;
 use OCP\AppFramework\Http\JSONResponse;
 use OCP\AppFramework\Http\TemplateResponse;
@@ -47,6 +44,7 @@ use OCP\AppFramework\Utility\ITimeFactory;
 use OCP\Defaults;
 use OCP\Encryption\IEncryptionModule;
 use OCP\Encryption\IManager;
+use OCP\HintException;
 use OCP\IConfig;
 use OCP\IInitialStateService;
 use OCP\IL10N;
@@ -58,6 +56,8 @@ use OCP\IUserManager;
 use OCP\Mail\IMailer;
 use OCP\Security\ICrypto;
 use OCP\Security\ISecureRandom;
+use function array_filter;
+use function count;
 use function reset;
 
 /**
index 54b2f9f4c21a9497c28a713ce6cd34925417b961..7c7400a05642253580ed78b7249b715447895f28 100644 (file)
--- a/index.php
+++ b/index.php
@@ -39,7 +39,7 @@ try {
 
        //show the user a detailed error page
        OC_Template::printExceptionErrorPage($ex, 503);
-} catch (\OC\HintException $ex) {
+} catch (\OCP\HintException $ex) {
        try {
                OC_Template::printErrorPage($ex->getMessage(), $ex->getHint(), 503);
        } catch (Exception $ex2) {
index 473a3419cb1436d57319f679c1b29937ab8f2732..45d06da0303333495f244b9d7c6df34371b05f67 100644 (file)
@@ -388,7 +388,7 @@ class OC {
                if (!empty($incompatibleShippedApps)) {
                        $l = \OC::$server->getL10N('core');
                        $hint = $l->t('The files of the app %1$s were not replaced correctly. Make sure it is a version compatible with the server.', [implode(', ', $incompatibleShippedApps)]);
-                       throw new \OC\HintException('The files of the app ' . implode(', ', $incompatibleShippedApps) . ' were not replaced correctly. Make sure it is a version compatible with the server.', $hint);
+                       throw new \OCP\HintException('The files of the app ' . implode(', ', $incompatibleShippedApps) . ' were not replaced correctly. Make sure it is a version compatible with the server.', $hint);
                }
 
                $tmpl->assign('appsToUpgrade', $appManager->getAppsNeedingUpgrade($ocVersion));
index 55d02c2feeb3ac27cdf21d27525042e985494674..82c40c800a4c73334dacc94acf34f0c103e540e8 100644 (file)
@@ -371,6 +371,7 @@ return array(
     'OCP\\Group\\Events\\UserAddedEvent' => $baseDir . '/lib/public/Group/Events/UserAddedEvent.php',
     'OCP\\Group\\Events\\UserRemovedEvent' => $baseDir . '/lib/public/Group/Events/UserRemovedEvent.php',
     'OCP\\Group\\ISubAdmin' => $baseDir . '/lib/public/Group/ISubAdmin.php',
+    'OCP\\HintException' => $baseDir . '/lib/public/HintException.php',
     'OCP\\Http\\Client\\IClient' => $baseDir . '/lib/public/Http/Client/IClient.php',
     'OCP\\Http\\Client\\IClientService' => $baseDir . '/lib/public/Http/Client/IClientService.php',
     'OCP\\Http\\Client\\IResponse' => $baseDir . '/lib/public/Http/Client/IResponse.php',
index 6f2bb064fc02b4c3215519aa5ea3d0c140528515..423fd814d6bd235574120bb154a95ba59cf67858 100644 (file)
@@ -400,6 +400,7 @@ class ComposerStaticInit53792487c5a8370acc0b06b1a864ff4c
         'OCP\\Group\\Events\\UserAddedEvent' => __DIR__ . '/../../..' . '/lib/public/Group/Events/UserAddedEvent.php',
         'OCP\\Group\\Events\\UserRemovedEvent' => __DIR__ . '/../../..' . '/lib/public/Group/Events/UserRemovedEvent.php',
         'OCP\\Group\\ISubAdmin' => __DIR__ . '/../../..' . '/lib/public/Group/ISubAdmin.php',
+        'OCP\\HintException' => __DIR__ . '/../../..' . '/lib/public/HintException.php',
         'OCP\\Http\\Client\\IClient' => __DIR__ . '/../../..' . '/lib/public/Http/Client/IClient.php',
         'OCP\\Http\\Client\\IClientService' => __DIR__ . '/../../..' . '/lib/public/Http/Client/IClientService.php',
         'OCP\\Http\\Client\\IResponse' => __DIR__ . '/../../..' . '/lib/public/Http/Client/IResponse.php',
index 37cc0b71e3f6651f522c2b9138d63d42171348bd..6c2f905afa5ac41be0916390b2233e79a0e749f7 100644 (file)
@@ -34,11 +34,11 @@ namespace OC\AppFramework;
 use OC\AppFramework\DependencyInjection\DIContainer;
 use OC\AppFramework\Http\Dispatcher;
 use OC\AppFramework\Http\Request;
-use OC\HintException;
 use OCP\AppFramework\Http;
 use OCP\AppFramework\Http\ICallbackResponse;
 use OCP\AppFramework\Http\IOutput;
 use OCP\AppFramework\QueryException;
+use OCP\HintException;
 use OCP\IRequest;
 
 /**
@@ -105,6 +105,7 @@ class App {
 
        /**
         * Shortcut for calling a controller method and printing the result
+        *
         * @param string $controllerName the name of the controller under which it is
         *                               stored in the DI container
         * @param string $methodName the method that you want to call
index e3ace96c359873b8cae7e3e36eb111d4f695021e..2a83d2300dcd40ec78ef1724bfc19065857d1d1d 100644 (file)
@@ -38,6 +38,8 @@
  */
 namespace OC;
 
+use OCP\HintException;
+
 /**
  * This class is responsible for reading and writing config.php, the very basic
  * configuration file of Nextcloud.
index b1b4956db41f149745be5c99f33369aea2ded4db..44583416dbcf54c3502a53d221cc243c398e3100 100644 (file)
@@ -22,5 +22,7 @@
  */
 namespace OC;
 
+use OCP\HintException;
+
 class DatabaseSetupException extends HintException {
 }
index e3173ba79fdb3809d51a73281c29467e1d9bdd7a..735832266cf4d767033cff2d16d9db3ab2ddfca7 100644 (file)
@@ -1,28 +1,28 @@
 <?php
+
+declare(strict_types=1);
 /**
- * @copyright Copyright (c) 2016, ownCloud, Inc.
+ * @copyright Copyright (c) 2021 Gary Kim <gary@garykim.dev>
  *
- * @author Arthur Schiwon <blizzz@arthur-schiwon.de>
- * @author Bart Visscher <bartv@thisnet.nl>
- * @author Lukas Reschke <lukas@statuscode.ch>
- * @author Michael Gapczynski <GapczynskiM@gmail.com>
- * @author Thomas Müller <thomas.mueller@tmit.eu>
+ * @author Gary Kim <gary@garykim.dev>
  *
- * @license AGPL-3.0
+ * @license GNU AGPL version 3 or any later version
  *
- * This code is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License, version 3,
- * as published by the Free Software Foundation.
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
  *
  * This program is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  * GNU Affero General Public License for more details.
  *
- * You should have received a copy of the GNU Affero General Public License, version 3,
- * along with this program. If not, see <http://www.gnu.org/licenses/>
+ * You should have received a copy of the GNU Affero General Public License
+ * along with this program.  If not, see <http://www.gnu.org/licenses/>.
  *
  */
+
 namespace OC;
 
 /**
@@ -31,48 +31,7 @@ namespace OC;
  * An Exception class with the intention to be presented to the end user
  *
  * @package OC
+ * @depreacted 23.0.0 Use \OCP\HintException
  */
-class HintException extends \Exception {
-       private $hint;
-
-       /**
-        * HintException constructor.
-        *
-        * @param string $message  The error message. It will be not revealed to the
-        *                         the user (unless the hint is empty) and thus
-        *                         should be not translated.
-        * @param string $hint     A useful message that is presented to the end
-        *                         user. It should be translated, but must not
-        *                         contain sensitive data.
-        * @param int $code
-        * @param \Exception|null $previous
-        */
-       public function __construct($message, $hint = '', $code = 0, \Exception $previous = null) {
-               $this->hint = $hint;
-               parent::__construct($message, $code, $previous);
-       }
-
-       /**
-        * Returns a string representation of this Exception that includes the error
-        * code, the message and the hint.
-        *
-        * @return string
-        */
-       public function __toString() {
-               return __CLASS__ . ": [{$this->code}]: {$this->message} ({$this->hint})\n";
-       }
-
-       /**
-        * Returns the hint with the intention to be presented to the end user. If
-        * an empty hint was specified upon instatiation, the message is returned
-        * instead.
-        *
-        * @return string
-        */
-       public function getHint() {
-               if (empty($this->hint)) {
-                       return $this->message;
-               }
-               return $this->hint;
-       }
+class HintException extends \OCP\HintException {
 }
index d1e903424ed5c3e13f0af12730a0a866d1b40633..19e70aad147984594e1c852e7d35d6f3067f2737 100644 (file)
@@ -48,6 +48,7 @@ use OC\DB\Connection;
 use OC\DB\MigrationService;
 use OC_App;
 use OC_Helper;
+use OCP\HintException;
 use OCP\Http\Client\IClientService;
 use OCP\IConfig;
 use OCP\ILogger;
index aba5586297ae6c4d8766012e04f0fc60d0932ea4..bab22ab4aac744fb17b6a13ba05cb1e8685792bb 100644 (file)
 namespace OC\Log;
 
 use OC\Core\Controller\SetupController;
-use OC\HintException;
 use OC\Security\IdentityProof\Key;
 use OC\Setup;
 use OC\SystemConfig;
+use OCP\HintException;
 
 class ExceptionSerializer {
        public const methodsWithSensitiveParameters = [
index 17778891efe5f9ee1b0c4285bcd2dedac888365b..a01826c0b0513b73e6411e938db4d32aca60ca31 100644 (file)
@@ -25,8 +25,8 @@
  */
 namespace OC\Log;
 
-use OC\HintException;
 use OC\SystemConfig;
+use OCP\HintException;
 use OCP\ILogger;
 use OCP\Log\IWriter;
 
index 9810f0681489cfc02f83c6daaeb66ea8d8cdbdc5..28a84308edc47f566a67fad23c8dc71c32c6f6cc 100644 (file)
@@ -86,12 +86,12 @@ class Factory implements ICacheFactory {
                $missingCacheMessage = 'Memcache {class} not available for {use} cache';
                $missingCacheHint = 'Is the matching PHP module installed and enabled?';
                if (!class_exists($localCacheClass) || !$localCacheClass::isAvailable()) {
-                       throw new \OC\HintException(strtr($missingCacheMessage, [
+                       throw new \OCP\HintException(strtr($missingCacheMessage, [
                                '{class}' => $localCacheClass, '{use}' => 'local'
                        ]), $missingCacheHint);
                }
                if (!class_exists($distributedCacheClass) || !$distributedCacheClass::isAvailable()) {
-                       throw new \OC\HintException(strtr($missingCacheMessage, [
+                       throw new \OCP\HintException(strtr($missingCacheMessage, [
                                '{class}' => $distributedCacheClass, '{use}' => 'distributed'
                        ]), $missingCacheHint);
                }
index cd1af031d8a001b47ed4952caf54a52645beb6ee..b3414a7d29005b7dd92a43de04b8ae7bea3b684b 100644 (file)
@@ -31,7 +31,7 @@
  */
 namespace OC\Memcache;
 
-use OC\HintException;
+use OCP\HintException;
 use OCP\IMemcache;
 
 class Memcached extends Cache implements IMemcache {
index 8e7e6ae6aea19e62f96ed91feea3ddea40d92208..d39fa069286992e279e27eaf337bd57f280b8f57 100644 (file)
@@ -224,7 +224,7 @@ class Setup {
                        try {
                                $util = new \OC_Util();
                                $htAccessWorking = $util->isHtaccessWorking(\OC::$server->getConfig());
-                       } catch (\OC\HintException $e) {
+                       } catch (\OCP\HintException $e) {
                                $errors[] = [
                                        'error' => $e->getMessage(),
                                        'exception' => $e,
index b5e1b944bc52de9c7f78234d81ec78648d841401..7047c32e33922afd048d33adcfe4f03c1884c647 100644 (file)
@@ -43,7 +43,6 @@ namespace OC\Share20;
 
 use OC\Cache\CappedMemoryCache;
 use OC\Files\Mount\MoveableMount;
-use OC\HintException;
 use OC\Share20\Exception\ProviderException;
 use OCA\Files_Sharing\ISharedStorage;
 use OCP\EventDispatcher\IEventDispatcher;
@@ -52,6 +51,7 @@ use OCP\Files\Folder;
 use OCP\Files\IRootFolder;
 use OCP\Files\Mount\IMountManager;
 use OCP\Files\Node;
+use OCP\HintException;
 use OCP\IConfig;
 use OCP\IGroupManager;
 use OCP\IL10N;
index 5fa41e48c0cb103fdd2880a901aa6d4f5ed5a0dd..cffdac310cb09f616af76d9ca458f79a350db687 100644 (file)
@@ -45,6 +45,7 @@ use OC\DB\MigrationService;
 use OC\Hooks\BasicEmitter;
 use OC\IntegrityCheck\Checker;
 use OC_App;
+use OCP\HintException;
 use OCP\IConfig;
 use OCP\ILogger;
 use OCP\Util;
index 07a599cf017ab7a326c146cfca6744f55ba85168..12c615d500b7691bfae738f242d65ff6ade64757 100644 (file)
  */
 namespace OC\User;
 
-use OC\HintException;
 use OC\Hooks\PublicEmitter;
 use OCP\DB\QueryBuilder\IQueryBuilder;
 use OCP\EventDispatcher\IEventDispatcher;
+use OCP\HintException;
 use OCP\ICache;
 use OCP\ICacheFactory;
 use OCP\IConfig;
index d9e4c99e498a024f3762ed7317600a7ca2b29bde..b223b0fa6d6c2163d09839fa74697fa1ebf40191 100644 (file)
@@ -81,7 +81,7 @@ class OC_Hook {
         * @param string $signalName name of signal
         * @param mixed $params default: array() array with additional data
         * @return bool true if slots exists or false if not
-        * @throws \OC\HintException
+        * @throws \OCP\HintException
         * @throws \OC\ServerNotAvailableException Emits a signal. To get data from the slot use references!
         *
         * TODO: write example
@@ -107,7 +107,7 @@ class OC_Hook {
                        } catch (Exception $e) {
                                self::$thrownExceptions[] = $e;
                                \OC::$server->getLogger()->logException($e);
-                               if ($e instanceof \OC\HintException) {
+                               if ($e instanceof \OCP\HintException) {
                                        throw $e;
                                }
                                if ($e instanceof \OC\ServerNotAvailableException) {
index 87964f98374ac81eb4d0e7a7e75979faca5d6aca..333b621e359ec67a46014686c17631d83239acf7 100644 (file)
@@ -63,6 +63,7 @@
  * along with this program. If not, see <http://www.gnu.org/licenses/>
  *
  */
+
 use bantu\IniGetWrapper\IniGetWrapper;
 use OC\AppFramework\Http\Request;
 use OC\Files\Storage\LocalRootStorage;
@@ -1214,7 +1215,7 @@ class OC_Util {
 
                $fp = @fopen($testFile, 'w');
                if (!$fp) {
-                       throw new OC\HintException('Can\'t create test file to check for working .htaccess file.',
+                       throw new \OCP\HintException('Can\'t create test file to check for working .htaccess file.',
                                'Make sure it is possible for the webserver to write to ' . $testFile);
                }
                fwrite($fp, $testContent);
@@ -1225,10 +1226,11 @@ class OC_Util {
 
        /**
         * Check if the .htaccess file is working
+        *
         * @param \OCP\IConfig $config
         * @return bool
         * @throws Exception
-        * @throws \OC\HintException If the test file can't get written.
+        * @throws \OCP\HintException If the test file can't get written.
         */
        public function isHtaccessWorking(\OCP\IConfig $config) {
                if (\OC::$CLI || !$config->getSystemValue('check_for_working_htaccess', true)) {
@@ -1422,7 +1424,7 @@ class OC_Util {
         *
         * @param \OC\SystemConfig $config
         * @return bool whether the core or any app needs an upgrade
-        * @throws \OC\HintException When the upgrade from the given version is not allowed
+        * @throws \OCP\HintException When the upgrade from the given version is not allowed
         */
        public static function needUpgrade(\OC\SystemConfig $config) {
                if ($config->getValue('installed', false)) {
@@ -1442,11 +1444,11 @@ class OC_Util {
                                        return true;
                                } else {
                                        // downgrade attempt, throw exception
-                                       throw new \OC\HintException('Downgrading is not supported and is likely to cause unpredictable issues (from ' . $installedVersion . ' to ' . $currentVersion . ')');
+                                       throw new \OCP\HintException('Downgrading is not supported and is likely to cause unpredictable issues (from ' . $installedVersion . ' to ' . $currentVersion . ')');
                                }
                        } elseif ($versionDiff < 0) {
                                // downgrade attempt, throw exception
-                               throw new \OC\HintException('Downgrading is not supported and is likely to cause unpredictable issues (from ' . $installedVersion . ' to ' . $currentVersion . ')');
+                               throw new \OCP\HintException('Downgrading is not supported and is likely to cause unpredictable issues (from ' . $installedVersion . ' to ' . $currentVersion . ')');
                        }
 
                        // also check for upgrades for apps (independently from the user)
index 9f349a28a7632510f9b239d283c19805afcaecb7..aef4114bb1b1b36401e833998827c874f2f4d11c 100644 (file)
@@ -26,7 +26,7 @@
  */
 namespace OCP\Encryption\Exceptions;
 
-use OC\HintException;
+use OCP\HintException;
 
 /**
  * Class GenericEncryptionException
index 3ec729e415a6e1889c28ffd1147435f32e6ca104..7b2ca3d9597821be0ea87162dafd326e7e57cd69 100644 (file)
@@ -22,7 +22,7 @@
  */
 namespace OCP\Federation\Exceptions;
 
-use OC\HintException;
+use OCP\HintException;
 
 /**
  * Class ActionNotSupportedException
index 61ea080f5d482b160b8d25740b6776fdef4f358e..dfcd963603573c168f30f11bf5a5ab552807b37b 100644 (file)
@@ -22,7 +22,7 @@
  */
 namespace OCP\Federation\Exceptions;
 
-use OC\HintException;
+use OCP\HintException;
 
 /**
  * Class AuthenticationFailedException
index bea6fba2b18e8873a6a5ddc77334438a44099eee..8054c0e89f00058401ce6500fe8b3aec9df249b7 100644 (file)
@@ -23,7 +23,7 @@
  */
 namespace OCP\Federation\Exceptions;
 
-use OC\HintException;
+use OCP\HintException;
 
 /**
  * Class BadRequestException
index 48aa883a028fefb5255eb4fdf0cd136239566cc5..b6d4b7e9bce14c60a926998dbb0bddb70a22cbc9 100644 (file)
@@ -24,7 +24,7 @@
  */
 namespace OCP\Federation\Exceptions;
 
-use OC\HintException;
+use OCP\HintException;
 
 /**
  * Class ProviderAlreadyExistsException
index c647b2d9c9e0381d3e0542a435a1f1e3571270bb..efcc87883861cf2ef3b585b1ab36d08dfe68367b 100644 (file)
@@ -22,8 +22,8 @@
  */
 namespace OCP\Federation\Exceptions;
 
-use OC\HintException;
 use OCP\AppFramework\Http;
+use OCP\HintException;
 
 /**
  * Class ProviderCouldNotAddShareException
index b56a6ef8d4c830b447fc9caf509b804520360833..69c69f17d991d3cce3d6336fd9d8deb1e95f7dc2 100644 (file)
@@ -22,7 +22,7 @@
  */
 namespace OCP\Federation\Exceptions;
 
-use OC\HintException;
+use OCP\HintException;
 
 /**
  * Class ProviderDoesNotExistsException
index e166df90d7709e000bb9444010750bd4ae384abd..f600ef808084d8bbd7712db42e49e8909cc5ab80 100644 (file)
@@ -32,7 +32,7 @@
 
 namespace OCP\Files;
 
-use OC\HintException;
+use OCP\HintException;
 
 /**
  * Storage is temporarily not available
diff --git a/lib/public/HintException.php b/lib/public/HintException.php
new file mode 100644 (file)
index 0000000..b5ee764
--- /dev/null
@@ -0,0 +1,82 @@
+<?php
+/**
+ * @copyright Copyright (c) 2016, ownCloud, Inc.
+ *
+ * @author Arthur Schiwon <blizzz@arthur-schiwon.de>
+ * @author Bart Visscher <bartv@thisnet.nl>
+ * @author Lukas Reschke <lukas@statuscode.ch>
+ * @author Michael Gapczynski <GapczynskiM@gmail.com>
+ * @author Thomas Müller <thomas.mueller@tmit.eu>
+ *
+ * @license AGPL-3.0
+ *
+ * This code is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License, version 3,
+ * as published by the Free Software Foundation.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Affero General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License, version 3,
+ * along with this program. If not, see <http://www.gnu.org/licenses/>
+ *
+ */
+namespace OCP;
+
+/**
+ * Class HintException
+ *
+ * An Exception class with the intention to be presented to the end user
+ *
+ * @package OCP
+ * @since 23.0.0
+ */
+class HintException extends \Exception {
+       private $hint;
+
+       /**
+        * HintException constructor.
+        *
+        * @since 23.0.0
+        * @param string $message  The error message. It will be not revealed to the
+        *                         the user (unless the hint is empty) and thus
+        *                         should be not translated.
+        * @param string $hint     A useful message that is presented to the end
+        *                         user. It should be translated, but must not
+        *                         contain sensitive data.
+        * @param int $code
+        * @param \Exception|null $previous
+        */
+       public function __construct($message, $hint = '', $code = 0, \Exception $previous = null) {
+               $this->hint = $hint;
+               parent::__construct($message, $code, $previous);
+       }
+
+       /**
+        * Returns a string representation of this Exception that includes the error
+        * code, the message and the hint.
+        *
+        * @since 23.0.0
+        * @return string
+        */
+       public function __toString(): string {
+               return __CLASS__ . ": [{$this->code}]: {$this->message} ({$this->hint})\n";
+       }
+
+       /**
+        * Returns the hint with the intention to be presented to the end user. If
+        * an empty hint was specified upon instatiation, the message is returned
+        * instead.
+        *
+        * @since 23.0.0
+        * @return string
+        */
+       public function getHint(): string {
+               if (empty($this->hint)) {
+                       return $this->message;
+               }
+               return $this->hint;
+       }
+}
index 46a46ac0ab7c03d973183928f5e64800eb90cde8..85c440e2387fb1a8cd8baf3ec63ada481f60e7b2 100644 (file)
@@ -24,7 +24,7 @@
  */
 namespace OCP\Share\Exceptions;
 
-use OC\HintException;
+use OCP\HintException;
 
 /**
  * Class GenericEncryptionException
index dfd65aed47facbc633bf8ecc52c423255e4363e8..190afd3be47c280ab05c6208338d3880a38d2419 100644 (file)
 
 namespace Tests\Core\Controller;
 
-use OC\HintException;
 use OC\User\Session;
 use OCA\Settings\Controller\ChangePasswordController;
 use OCP\App\IAppManager;
 use OCP\AppFramework\Http\JSONResponse;
+use OCP\HintException;
 use OCP\IGroupManager;
 use OCP\IL10N;
 use OCP\IRequest;
index 19edf4aa3dd8faec4b054f261289a383461c1c2c..858bdc5d3ef60879aec20f9b0c5e479b732efcb0 100644 (file)
@@ -129,7 +129,7 @@ class FactoryTest extends \Test\TestCase {
         * @dataProvider cacheUnavailableProvider
         */
        public function testCacheNotAvailableException($localCache, $distributedCache) {
-               $this->expectException(\OC\HintException::class);
+               $this->expectException(\OCP\HintException::class);
 
                $logger = $this->getMockBuilder(ILogger::class)->getMock();
                new \OC\Memcache\Factory('abc', $logger, $localCache, $distributedCache);
index 117adc951861e2e5fb99abf57cd1e0d682cf86b4..de8dc9fcc862d2b4832cd27b803d73f356b029f9 100644 (file)
@@ -22,7 +22,6 @@
 namespace Test\Share20;
 
 use OC\Files\Mount\MoveableMount;
-use OC\HintException;
 use OC\Share20\DefaultShareProvider;
 use OC\Share20\Exception;
 use OC\Share20\Manager;
@@ -36,6 +35,7 @@ use OCP\Files\Mount\IMountManager;
 use OCP\Files\Mount\IMountPoint;
 use OCP\Files\Node;
 use OCP\Files\Storage;
+use OCP\HintException;
 use OCP\IConfig;
 use OCP\IGroup;
 use OCP\IGroupManager;
index 6eb4466c69d35555b481fce497ac2a8532562a89..49b691cf9bc4f910213ff628f5a8c7d7224ff420 100644 (file)
 
 namespace Test\User;
 
-use OC\HintException;
 use OC\User\User;
 use OCP\EventDispatcher\Event;
 use OCP\EventDispatcher\IEventDispatcher;
+use OCP\HintException;
 use OCP\Security\Events\ValidatePasswordPolicyEvent;
 use PHPUnit\Framework\MockObject\MockObject;
 use Symfony\Component\EventDispatcher\EventDispatcherInterface;
@@ -82,9 +82,9 @@ class DatabaseTest extends Backend {
                $this->assertSame($user, $this->backend->checkPassword($user, 'newpass'));
        }
 
-       
+
        public function testVerifyPasswordEventFail() {
-               $this->expectException(\OC\HintException::class);
+               $this->expectException(\OCP\HintException::class);
                $this->expectExceptionMessage('password change failed');
 
                $user = $this->getUser();