chore(OC\Share\Constants): Remove unused SHARE_TYPE_* constants

Signed-off-by: provokateurin <kate@provokateurin.de>
This commit is contained in:
provokateurin 2025-07-15 11:38:42 +02:00
parent 8bc5edf15f
commit 3c7fce39aa
No known key found for this signature in database
3 changed files with 2 additions and 54 deletions

View file

@ -11,7 +11,7 @@ use OCP\Collaboration\Collaborators\ISearchPlugin;
use OCP\Collaboration\Collaborators\ISearchResult;
use OCP\Collaboration\Collaborators\SearchResultType;
use OCP\IContainer;
use OCP\Share;
use OCP\Share\IShare;
class Search implements ISearch {
protected array $pluginList = [];
@ -81,7 +81,7 @@ class Search implements ISearch {
}
public function registerPlugin(array $pluginInfo): void {
$shareType = constant(Share::class . '::' . $pluginInfo['shareType']);
$shareType = constant(IShare::class . '::' . substr($pluginInfo['shareType'], strlen('SHARE_')));
if ($shareType === null) {
throw new \InvalidArgumentException('Provided ShareType is invalid');
}

View file

@ -7,56 +7,7 @@
*/
namespace OC\Share;
use OCP\Share\IShare;
class Constants {
/**
* @deprecated 17.0.0 - use IShare::TYPE_USER instead
*/
public const SHARE_TYPE_USER = 0;
/**
* @deprecated 17.0.0 - use IShare::TYPE_GROUP instead
*/
public const SHARE_TYPE_GROUP = 1;
// const SHARE_TYPE_USERGROUP = 2; // Internal type used by DefaultShareProvider
/**
* @deprecated 17.0.0 - use IShare::TYPE_LINK instead
*/
public const SHARE_TYPE_LINK = 3;
/**
* @deprecated 17.0.0 - use IShare::TYPE_EMAIL instead
*/
public const SHARE_TYPE_EMAIL = 4;
public const SHARE_TYPE_CONTACT = 5; // ToDo Check if it is still in use otherwise remove it
/**
* @deprecated 17.0.0 - use IShare::TYPE_REMOTE instead
*/
public const SHARE_TYPE_REMOTE = 6;
/**
* @deprecated 17.0.0 - use IShare::TYPE_CIRCLE instead
*/
public const SHARE_TYPE_CIRCLE = 7;
/**
* @deprecated 17.0.0 - use IShare::TYPE_GUEST instead
*/
public const SHARE_TYPE_GUEST = 8;
/**
* @deprecated 17.0.0 - use IShare::REMOTE_GROUP instead
*/
public const SHARE_TYPE_REMOTE_GROUP = 9;
/**
* @deprecated 17.0.0 - use IShare::TYPE_ROOM instead
*/
public const SHARE_TYPE_ROOM = 10;
// const SHARE_TYPE_USERROOM = 11; // Internal type used by RoomShareProvider
/**
* @deprecated 21.0.0 - use IShare::TYPE_DECK instead
*/
public const SHARE_TYPE_DECK = 12;
// const SHARE_TYPE_DECK_USER = 13; // Internal type used by DeckShareProvider
// Note to developers: Do not add new share types here
public const FORMAT_NONE = -1;
public const FORMAT_STATUSES = -2;
public const FORMAT_SOURCES = -3; // ToDo Check if it is still in use otherwise remove it

View file

@ -43,9 +43,6 @@ use function str_starts_with;
* @package OC\Share20
*/
class DefaultShareProvider implements IShareProviderWithNotification, IShareProviderSupportsAccept, IShareProviderSupportsAllSharesInFolder {
// Special share type for user modified group shares
public const SHARE_TYPE_USERGROUP = 2;
public function __construct(
private IDBConnection $dbConn,
private IUserManager $userManager,