Skip to content

Commit 4cea5b9

Browse files
committed
Migrate HintException to OCP
Signed-off-by: Gary Kim <gary@garykim.dev>
1 parent 4aece4c commit 4cea5b9

59 files changed

Lines changed: 184 additions & 136 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

apps/federatedfilesharing/lib/AddressHandler.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,8 @@
2525
*/
2626
namespace OCA\FederatedFileSharing;
2727

28-
use OC\HintException;
2928
use OCP\Federation\ICloudIdManager;
29+
use OCP\HintException;
3030
use OCP\IL10N;
3131
use OCP\IURLGenerator;
3232

apps/federatedfilesharing/lib/Controller/MountPublicLinkController.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,14 +31,14 @@
3131
*/
3232
namespace OCA\FederatedFileSharing\Controller;
3333

34-
use OC\HintException;
3534
use OCA\FederatedFileSharing\AddressHandler;
3635
use OCA\FederatedFileSharing\FederatedShareProvider;
3736
use OCP\AppFramework\Controller;
3837
use OCP\AppFramework\Http;
3938
use OCP\AppFramework\Http\JSONResponse;
4039
use OCP\Constants;
4140
use OCP\Federation\ICloudIdManager;
41+
use OCP\HintException;
4242
use OCP\Http\Client\IClientService;
4343
use OCP\IL10N;
4444
use OCP\ILogger;

apps/federatedfilesharing/lib/Controller/RequestHandlerController.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -230,7 +230,7 @@ public function reShare($id) {
230230
* @return Http\DataResponse
231231
* @throws OCSException
232232
* @throws ShareNotFound
233-
* @throws \OC\HintException
233+
* @throws \OCP\HintException
234234
*/
235235
public function acceptShare($id) {
236236
$token = isset($_POST['token']) ? $_POST['token'] : null;

apps/federatedfilesharing/lib/FederatedShareProvider.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -441,7 +441,7 @@ public function update(IShare $share) {
441441
*
442442
* @param IShare $share
443443
* @throws ShareNotFound
444-
* @throws \OC\HintException
444+
* @throws \OCP\HintException
445445
*/
446446
protected function sendPermissionUpdate(IShare $share) {
447447
$remoteId = $this->getRemoteId($share);
@@ -550,7 +550,7 @@ public function getChildren(IShare $parent) {
550550
*
551551
* @param IShare $share
552552
* @throws ShareNotFound
553-
* @throws \OC\HintException
553+
* @throws \OCP\HintException
554554
*/
555555
public function delete(IShare $share) {
556556
[, $remote] = $this->addressHandler->splitUserRemote($share->getSharedWith());
@@ -577,7 +577,7 @@ public function delete(IShare $share) {
577577
* @param IShare $share
578578
* @param bool $isOwner the user can either be the owner or the user who re-sahred it
579579
* @throws ShareNotFound
580-
* @throws \OC\HintException
580+
* @throws \OCP\HintException
581581
*/
582582
protected function revokeShare($share, $isOwner) {
583583
if ($this->userManager->userExists($share->getShareOwner()) && $this->userManager->userExists($share->getSharedBy())) {

apps/federatedfilesharing/lib/Notifications.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,8 @@
3434
use OCP\Federation\ICloudFederationFactory;
3535
use OCP\Federation\ICloudFederationProviderManager;
3636
use OCP\Http\Client\IClientService;
37-
use OCP\OCS\IDiscoveryService;
3837
use OCP\ILogger;
38+
use OCP\OCS\IDiscoveryService;
3939

4040
class Notifications {
4141
public const RESPONSE_FORMAT = 'json'; // default response format for ocs calls
@@ -97,7 +97,7 @@ public function __construct(
9797
* @param string $sharedByFederatedId
9898
* @param int $shareType (can be a remote user or group share)
9999
* @return bool
100-
* @throws \OC\HintException
100+
* @throws \OCP\HintException
101101
* @throws \OC\ServerNotAvailableException
102102
*/
103103
public function sendRemoteShare($token, $shareWith, $name, $remoteId, $owner, $ownerFederatedId, $sharedBy, $sharedByFederatedId, $shareType) {
@@ -156,7 +156,7 @@ public function sendRemoteShare($token, $shareWith, $name, $remoteId, $owner, $o
156156
* @param int $permission
157157
* @param string $filename
158158
* @return array|false
159-
* @throws \OC\HintException
159+
* @throws \OCP\HintException
160160
* @throws \OC\ServerNotAvailableException
161161
*/
162162
public function requestReShare($token, $id, $shareId, $remote, $shareWith, $permission, $filename) {

apps/federatedfilesharing/lib/Notifier.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,10 +27,10 @@
2727
*/
2828
namespace OCA\FederatedFileSharing;
2929

30-
use OC\HintException;
3130
use OCP\Contacts\IManager;
3231
use OCP\Federation\ICloudId;
3332
use OCP\Federation\ICloudIdManager;
33+
use OCP\HintException;
3434
use OCP\IURLGenerator;
3535
use OCP\L10N\IFactory;
3636
use OCP\Notification\INotification;

apps/federatedfilesharing/lib/OCM/CloudFederationProviderFiles.php

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,6 @@
3030

3131
use OC\AppFramework\Http;
3232
use OC\Files\Filesystem;
33-
use OC\HintException;
3433
use OCA\FederatedFileSharing\AddressHandler;
3534
use OCA\FederatedFileSharing\FederatedShareProvider;
3635
use OCA\Files_Sharing\Activity\Providers\RemoteShares;
@@ -48,14 +47,14 @@
4847
use OCP\Federation\ICloudFederationShare;
4948
use OCP\Federation\ICloudIdManager;
5049
use OCP\Files\NotFoundException;
50+
use OCP\HintException;
5151
use OCP\IConfig;
5252
use OCP\IDBConnection;
5353
use OCP\IGroupManager;
5454
use OCP\ILogger;
5555
use OCP\IURLGenerator;
5656
use OCP\IUserManager;
5757
use OCP\Notification\IManager as INotificationManager;
58-
use OCP\Share;
5958
use OCP\Share\Exceptions\ShareNotFound;
6059
use OCP\Share\IManager;
6160
use OCP\Share\IShare;
@@ -176,7 +175,7 @@ public function getShareType() {
176175
*
177176
* @throws ProviderCouldNotAddShareException
178177
* @throws \OCP\AppFramework\QueryException
179-
* @throws \OC\HintException
178+
* @throws HintException
180179
* @since 14.0.0
181180
*/
182181
public function shareReceived(ICloudFederationShare $share) {
@@ -305,7 +304,7 @@ public function shareReceived(ICloudFederationShare $share) {
305304
* @throws ActionNotSupportedException
306305
* @throws AuthenticationFailedException
307306
* @throws BadRequestException
308-
* @throws \OC\HintException
307+
* @throws HintException
309308
* @since 14.0.0
310309
*/
311310
public function notificationReceived($notificationType, $providerId, array $notification) {
@@ -373,7 +372,7 @@ private function notifyAboutNewShare($shareWith, $shareId, $ownerFederatedId, $s
373372
* @throws ActionNotSupportedException
374373
* @throws AuthenticationFailedException
375374
* @throws BadRequestException
376-
* @throws \OC\HintException
375+
* @throws HintException
377376
*/
378377
private function shareAccepted($id, array $notification) {
379378
if (!$this->isS2SEnabled()) {
@@ -442,7 +441,7 @@ protected function executeAcceptShare(IShare $share) {
442441
* @throws AuthenticationFailedException
443442
* @throws BadRequestException
444443
* @throws ShareNotFound
445-
* @throws \OC\HintException
444+
* @throws HintException
446445
*
447446
*/
448447
protected function shareDeclined($id, array $notification) {

apps/federatedfilesharing/tests/AddressHandlerTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,7 @@ public function dataTestSplitUserRemoteError() {
136136
* @param string $id
137137
*/
138138
public function testSplitUserRemoteError($id) {
139-
$this->expectException(\OC\HintException::class);
139+
$this->expectException(\OCP\HintException::class);
140140

141141
$this->addressHandler->splitUserRemote($id);
142142
}

apps/federatedfilesharing/tests/Controller/MountPublicLinkControllerTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,14 +29,14 @@
2929
namespace OCA\FederatedFileSharing\Tests\Controller;
3030

3131
use OC\Federation\CloudIdManager;
32-
use OC\HintException;
3332
use OCA\FederatedFileSharing\AddressHandler;
3433
use OCA\FederatedFileSharing\Controller\MountPublicLinkController;
3534
use OCA\FederatedFileSharing\FederatedShareProvider;
3635
use OCP\AppFramework\Http;
3736
use OCP\Contacts\IManager as IContactsManager;
3837
use OCP\Federation\ICloudIdManager;
3938
use OCP\Files\IRootFolder;
39+
use OCP\HintException;
4040
use OCP\Http\Client\IClientService;
4141
use OCP\IL10N;
4242
use OCP\IRequest;

apps/federation/lib/Controller/SettingsController.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,10 +23,10 @@
2323
*/
2424
namespace OCA\Federation\Controller;
2525

26-
use OC\HintException;
2726
use OCA\Federation\TrustedServers;
2827
use OCP\AppFramework\Controller;
2928
use OCP\AppFramework\Http\DataResponse;
29+
use OCP\HintException;
3030
use OCP\IL10N;
3131
use OCP\IRequest;
3232

0 commit comments

Comments
 (0)