Skip to content

Commit b8ad6d0

Browse files
authored
Merge pull request #53945 from nextcloud/chore/share-constants
chore(OC\Share\Constants): Remove unused SHARE_TYPE_* constants
2 parents 49618b3 + 3c7fce3 commit b8ad6d0

File tree

3 files changed

+2
-54
lines changed

3 files changed

+2
-54
lines changed

lib/private/Collaboration/Collaborators/Search.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
use OCP\Collaboration\Collaborators\ISearchResult;
1212
use OCP\Collaboration\Collaborators\SearchResultType;
1313
use OCP\IContainer;
14-
use OCP\Share;
14+
use OCP\Share\IShare;
1515

1616
class Search implements ISearch {
1717
protected array $pluginList = [];
@@ -81,7 +81,7 @@ public function search($search, array $shareTypes, $lookup, $limit, $offset): ar
8181
}
8282

8383
public function registerPlugin(array $pluginInfo): void {
84-
$shareType = constant(Share::class . '::' . $pluginInfo['shareType']);
84+
$shareType = constant(IShare::class . '::' . substr($pluginInfo['shareType'], strlen('SHARE_')));
8585
if ($shareType === null) {
8686
throw new \InvalidArgumentException('Provided ShareType is invalid');
8787
}

lib/private/Share/Constants.php

Lines changed: 0 additions & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -7,56 +7,7 @@
77
*/
88
namespace OC\Share;
99

10-
use OCP\Share\IShare;
11-
1210
class Constants {
13-
/**
14-
* @deprecated 17.0.0 - use IShare::TYPE_USER instead
15-
*/
16-
public const SHARE_TYPE_USER = 0;
17-
/**
18-
* @deprecated 17.0.0 - use IShare::TYPE_GROUP instead
19-
*/
20-
public const SHARE_TYPE_GROUP = 1;
21-
// const SHARE_TYPE_USERGROUP = 2; // Internal type used by DefaultShareProvider
22-
/**
23-
* @deprecated 17.0.0 - use IShare::TYPE_LINK instead
24-
*/
25-
public const SHARE_TYPE_LINK = 3;
26-
/**
27-
* @deprecated 17.0.0 - use IShare::TYPE_EMAIL instead
28-
*/
29-
public const SHARE_TYPE_EMAIL = 4;
30-
public const SHARE_TYPE_CONTACT = 5; // ToDo Check if it is still in use otherwise remove it
31-
/**
32-
* @deprecated 17.0.0 - use IShare::TYPE_REMOTE instead
33-
*/
34-
public const SHARE_TYPE_REMOTE = 6;
35-
/**
36-
* @deprecated 17.0.0 - use IShare::TYPE_CIRCLE instead
37-
*/
38-
public const SHARE_TYPE_CIRCLE = 7;
39-
/**
40-
* @deprecated 17.0.0 - use IShare::TYPE_GUEST instead
41-
*/
42-
public const SHARE_TYPE_GUEST = 8;
43-
/**
44-
* @deprecated 17.0.0 - use IShare::REMOTE_GROUP instead
45-
*/
46-
public const SHARE_TYPE_REMOTE_GROUP = 9;
47-
/**
48-
* @deprecated 17.0.0 - use IShare::TYPE_ROOM instead
49-
*/
50-
public const SHARE_TYPE_ROOM = 10;
51-
// const SHARE_TYPE_USERROOM = 11; // Internal type used by RoomShareProvider
52-
/**
53-
* @deprecated 21.0.0 - use IShare::TYPE_DECK instead
54-
*/
55-
public const SHARE_TYPE_DECK = 12;
56-
// const SHARE_TYPE_DECK_USER = 13; // Internal type used by DeckShareProvider
57-
58-
// Note to developers: Do not add new share types here
59-
6011
public const FORMAT_NONE = -1;
6112
public const FORMAT_STATUSES = -2;
6213
public const FORMAT_SOURCES = -3; // ToDo Check if it is still in use otherwise remove it

lib/private/Share20/DefaultShareProvider.php

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -45,9 +45,6 @@
4545
* @package OC\Share20
4646
*/
4747
class DefaultShareProvider implements IShareProviderWithNotification, IShareProviderSupportsAccept, IShareProviderSupportsAllSharesInFolder {
48-
// Special share type for user modified group shares
49-
public const SHARE_TYPE_USERGROUP = 2;
50-
5148
public function __construct(
5249
private IDBConnection $dbConn,
5350
private IUserManager $userManager,

0 commit comments

Comments
 (0)