diff options
Diffstat (limited to 'apps')
26 files changed, 41 insertions, 42 deletions
diff --git a/apps/encryption/lib/Command/FixEncryptedVersion.php b/apps/encryption/lib/Command/FixEncryptedVersion.php index a85a96258fc..da8a69cf464 100644 --- a/apps/encryption/lib/Command/FixEncryptedVersion.php +++ b/apps/encryption/lib/Command/FixEncryptedVersion.php @@ -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; diff --git a/apps/federatedfilesharing/lib/AddressHandler.php b/apps/federatedfilesharing/lib/AddressHandler.php index 5b50be2a53a..d76ff9518b6 100644 --- a/apps/federatedfilesharing/lib/AddressHandler.php +++ b/apps/federatedfilesharing/lib/AddressHandler.php @@ -25,8 +25,8 @@ */ namespace OCA\FederatedFileSharing; -use OC\HintException; use OCP\Federation\ICloudIdManager; +use OCP\HintException; use OCP\IL10N; use OCP\IURLGenerator; diff --git a/apps/federatedfilesharing/lib/Controller/MountPublicLinkController.php b/apps/federatedfilesharing/lib/Controller/MountPublicLinkController.php index 6e66e7f9b4a..404077e46af 100644 --- a/apps/federatedfilesharing/lib/Controller/MountPublicLinkController.php +++ b/apps/federatedfilesharing/lib/Controller/MountPublicLinkController.php @@ -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; diff --git a/apps/federatedfilesharing/lib/Controller/RequestHandlerController.php b/apps/federatedfilesharing/lib/Controller/RequestHandlerController.php index 99adefde000..f19e251fc7a 100644 --- a/apps/federatedfilesharing/lib/Controller/RequestHandlerController.php +++ b/apps/federatedfilesharing/lib/Controller/RequestHandlerController.php @@ -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; diff --git a/apps/federatedfilesharing/lib/FederatedShareProvider.php b/apps/federatedfilesharing/lib/FederatedShareProvider.php index d5fa99ef231..52b10cd9315 100644 --- a/apps/federatedfilesharing/lib/FederatedShareProvider.php +++ b/apps/federatedfilesharing/lib/FederatedShareProvider.php @@ -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())) { diff --git a/apps/federatedfilesharing/lib/Notifications.php b/apps/federatedfilesharing/lib/Notifications.php index c72a0691fad..2a162abcd76 100644 --- a/apps/federatedfilesharing/lib/Notifications.php +++ b/apps/federatedfilesharing/lib/Notifications.php @@ -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) { diff --git a/apps/federatedfilesharing/lib/Notifier.php b/apps/federatedfilesharing/lib/Notifier.php index a551a3cca0c..fa0119010cf 100644 --- a/apps/federatedfilesharing/lib/Notifier.php +++ b/apps/federatedfilesharing/lib/Notifier.php @@ -27,10 +27,10 @@ */ 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; diff --git a/apps/federatedfilesharing/lib/OCM/CloudFederationProviderFiles.php b/apps/federatedfilesharing/lib/OCM/CloudFederationProviderFiles.php index 26b0288c354..cc6b260add6 100644 --- a/apps/federatedfilesharing/lib/OCM/CloudFederationProviderFiles.php +++ b/apps/federatedfilesharing/lib/OCM/CloudFederationProviderFiles.php @@ -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) { diff --git a/apps/federatedfilesharing/tests/AddressHandlerTest.php b/apps/federatedfilesharing/tests/AddressHandlerTest.php index d1d4f9cd70e..f21d29ebd7e 100644 --- a/apps/federatedfilesharing/tests/AddressHandlerTest.php +++ b/apps/federatedfilesharing/tests/AddressHandlerTest.php @@ -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); } diff --git a/apps/federatedfilesharing/tests/Controller/MountPublicLinkControllerTest.php b/apps/federatedfilesharing/tests/Controller/MountPublicLinkControllerTest.php index 385f644f6b4..d3a87a4c416 100644 --- a/apps/federatedfilesharing/tests/Controller/MountPublicLinkControllerTest.php +++ b/apps/federatedfilesharing/tests/Controller/MountPublicLinkControllerTest.php @@ -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; diff --git a/apps/federation/lib/Controller/SettingsController.php b/apps/federation/lib/Controller/SettingsController.php index 86c1df89caf..970211e4103 100644 --- a/apps/federation/lib/Controller/SettingsController.php +++ b/apps/federation/lib/Controller/SettingsController.php @@ -23,10 +23,10 @@ */ 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; diff --git a/apps/federation/lib/DbHandler.php b/apps/federation/lib/DbHandler.php index ce4d1d7e44a..1dd0d1fc1c4 100644 --- a/apps/federation/lib/DbHandler.php +++ b/apps/federation/lib/DbHandler.php @@ -28,7 +28,7 @@ namespace OCA\Federation; use OC\Files\Filesystem; -use OC\HintException; +use OCP\HintException; use OCP\IDBConnection; use OCP\IL10N; diff --git a/apps/federation/lib/Middleware/AddServerMiddleware.php b/apps/federation/lib/Middleware/AddServerMiddleware.php index 2cfdad133ca..de6f7786679 100644 --- a/apps/federation/lib/Middleware/AddServerMiddleware.php +++ b/apps/federation/lib/Middleware/AddServerMiddleware.php @@ -28,12 +28,12 @@ */ 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; diff --git a/apps/federation/lib/TrustedServers.php b/apps/federation/lib/TrustedServers.php index c1dced62102..57b9a505499 100644 --- a/apps/federation/lib/TrustedServers.php +++ b/apps/federation/lib/TrustedServers.php @@ -27,11 +27,11 @@ */ 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; diff --git a/apps/federation/tests/Controller/SettingsControllerTest.php b/apps/federation/tests/Controller/SettingsControllerTest.php index 1f3617de389..856dcaa533f 100644 --- a/apps/federation/tests/Controller/SettingsControllerTest.php +++ b/apps/federation/tests/Controller/SettingsControllerTest.php @@ -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()) diff --git a/apps/federation/tests/Middleware/AddServerMiddlewareTest.php b/apps/federation/tests/Middleware/AddServerMiddlewareTest.php index fdd9d1682d4..c3370cdbe90 100644 --- a/apps/federation/tests/Middleware/AddServerMiddlewareTest.php +++ b/apps/federation/tests/Middleware/AddServerMiddlewareTest.php @@ -26,10 +26,10 @@ */ 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; diff --git a/apps/federation/tests/TrustedServersTest.php b/apps/federation/tests/TrustedServersTest.php index 3dd237ffcd3..3dd93a445cd 100644 --- a/apps/federation/tests/TrustedServersTest.php +++ b/apps/federation/tests/TrustedServersTest.php @@ -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]); diff --git a/apps/files_sharing/lib/Controller/ShareController.php b/apps/files_sharing/lib/Controller/ShareController.php index fbee6bf4b77..95c3303ae74 100644 --- a/apps/files_sharing/lib/Controller/ShareController.php +++ b/apps/files_sharing/lib/Controller/ShareController.php @@ -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 = '') { diff --git a/apps/provisioning_api/lib/Controller/UsersController.php b/apps/provisioning_api/lib/Controller/UsersController.php index d94e8fed8a8..01e4bac9c2b 100644 --- a/apps/provisioning_api/lib/Controller/UsersController.php +++ b/apps/provisioning_api/lib/Controller/UsersController.php @@ -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; diff --git a/apps/settings/lib/Controller/ChangePasswordController.php b/apps/settings/lib/Controller/ChangePasswordController.php index 76ac2f792ac..8dd1e6ba028 100644 --- a/apps/settings/lib/Controller/ChangePasswordController.php +++ b/apps/settings/lib/Controller/ChangePasswordController.php @@ -36,11 +36,11 @@ 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; diff --git a/apps/sharebymail/lib/ShareByMailProvider.php b/apps/sharebymail/lib/ShareByMailProvider.php index b5226850fa4..74e78c48d86 100644 --- a/apps/sharebymail/lib/ShareByMailProvider.php +++ b/apps/sharebymail/lib/ShareByMailProvider.php @@ -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; diff --git a/apps/sharebymail/tests/ShareByMailProviderTest.php b/apps/sharebymail/tests/ShareByMailProviderTest.php index 9c3b6525736..64d81aab254 100644 --- a/apps/sharebymail/tests/ShareByMailProviderTest.php +++ b/apps/sharebymail/tests/ShareByMailProviderTest.php @@ -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'); diff --git a/apps/user_ldap/lib/Access.php b/apps/user_ldap/lib/Access.php index 47cecd1bf7d..33329c0f03a 100644 --- a/apps/user_ldap/lib/Access.php +++ b/apps/user_ldap/lib/Access.php @@ -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; diff --git a/apps/user_ldap/lib/Controller/RenewPasswordController.php b/apps/user_ldap/lib/Controller/RenewPasswordController.php index eb8b19192c3..66371cb3b49 100644 --- a/apps/user_ldap/lib/Controller/RenewPasswordController.php +++ b/apps/user_ldap/lib/Controller/RenewPasswordController.php @@ -23,10 +23,10 @@ */ 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', [ diff --git a/apps/user_ldap/tests/AccessTest.php b/apps/user_ldap/tests/AccessTest.php index ae07ea509ef..e49faca70cc 100644 --- a/apps/user_ldap/tests/AccessTest.php +++ b/apps/user_ldap/tests/AccessTest.php @@ -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 diff --git a/apps/user_ldap/tests/User_LDAPTest.php b/apps/user_ldap/tests/User_LDAPTest.php index 78767ff6760..3142a256c9a 100644 --- a/apps/user_ldap/tests/User_LDAPTest.php +++ b/apps/user_ldap/tests/User_LDAPTest.php @@ -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()) |