diff --git a/apps/dav/composer/composer/autoload_static.php b/apps/dav/composer/composer/autoload_static.php index fad494f1c6fe6..5aa979e007acc 100644 --- a/apps/dav/composer/composer/autoload_static.php +++ b/apps/dav/composer/composer/autoload_static.php @@ -7,14 +7,14 @@ class ComposerStaticInitDAV { public static $prefixLengthsPsr4 = array ( - 'O' => + 'O' => array ( 'OCA\\DAV\\' => 8, ), ); public static $prefixDirsPsr4 = array ( - 'OCA\\DAV\\' => + 'OCA\\DAV\\' => array ( 0 => __DIR__ . '/..' . '/../lib', ), diff --git a/apps/files/lib/AppInfo/Application.php b/apps/files/lib/AppInfo/Application.php index a75858884c4b6..2a61519da737f 100644 --- a/apps/files/lib/AppInfo/Application.php +++ b/apps/files/lib/AppInfo/Application.php @@ -9,6 +9,7 @@ namespace OCA\Files\AppInfo; +use NCU\Sharing\ISharingRegistry; use OC\Core\Sharing\Permission\EditSharePermissionPreset; use OC\Core\Sharing\Permission\ViewSharePermissionPreset; use OC\Core\Sharing\Property\ExpirationDateSharePropertyType; @@ -60,7 +61,6 @@ use OCP\Share\Events\ShareCreatedEvent; use OCP\Share\Events\ShareDeletedEvent; use OCP\Share\Events\ShareDeletedFromSelfEvent; -use OCP\Sharing\ISharingRegistry; use OCP\User\Events\UserFirstTimeLoggedInEvent; class Application extends App implements IBootstrap { diff --git a/apps/files/lib/Sharing/Permission/NodeCreateSharePermissionType.php b/apps/files/lib/Sharing/Permission/NodeCreateSharePermissionType.php index a34369ab4b269..1648b1553b467 100644 --- a/apps/files/lib/Sharing/Permission/NodeCreateSharePermissionType.php +++ b/apps/files/lib/Sharing/Permission/NodeCreateSharePermissionType.php @@ -9,11 +9,11 @@ namespace OCA\Files\Sharing\Permission; +use NCU\Sharing\Permission\ISharePermissionType; use OCA\Files\AppInfo\Application; use OCP\Constants; use OCP\IAppConfig; use OCP\L10N\IFactory; -use OCP\Sharing\Permission\ISharePermissionType; final readonly class NodeCreateSharePermissionType implements ISharePermissionType { public function __construct( diff --git a/apps/files/lib/Sharing/Permission/NodeDeleteSharePermissionType.php b/apps/files/lib/Sharing/Permission/NodeDeleteSharePermissionType.php index 60468009d31d2..f91a3f07342a5 100644 --- a/apps/files/lib/Sharing/Permission/NodeDeleteSharePermissionType.php +++ b/apps/files/lib/Sharing/Permission/NodeDeleteSharePermissionType.php @@ -9,11 +9,11 @@ namespace OCA\Files\Sharing\Permission; +use NCU\Sharing\Permission\ISharePermissionType; use OCA\Files\AppInfo\Application; use OCP\Constants; use OCP\IAppConfig; use OCP\L10N\IFactory; -use OCP\Sharing\Permission\ISharePermissionType; final readonly class NodeDeleteSharePermissionType implements ISharePermissionType { public function __construct( diff --git a/apps/files/lib/Sharing/Permission/NodeDownloadSharePermissionType.php b/apps/files/lib/Sharing/Permission/NodeDownloadSharePermissionType.php index 653d3e7ecdb14..e23de3b13ccd3 100644 --- a/apps/files/lib/Sharing/Permission/NodeDownloadSharePermissionType.php +++ b/apps/files/lib/Sharing/Permission/NodeDownloadSharePermissionType.php @@ -9,10 +9,10 @@ namespace OCA\Files\Sharing\Permission; +use NCU\Sharing\Permission\ISharePermissionType; use OCA\Files\AppInfo\Application; use OCP\L10N\IFactory; use OCP\Share\IManager; -use OCP\Sharing\Permission\ISharePermissionType; final readonly class NodeDownloadSharePermissionType implements ISharePermissionType { public function __construct( diff --git a/apps/files/lib/Sharing/Permission/NodeReadSharePermissionType.php b/apps/files/lib/Sharing/Permission/NodeReadSharePermissionType.php index cdaf7fd558e1b..6fdbd35f4f232 100644 --- a/apps/files/lib/Sharing/Permission/NodeReadSharePermissionType.php +++ b/apps/files/lib/Sharing/Permission/NodeReadSharePermissionType.php @@ -9,9 +9,9 @@ namespace OCA\Files\Sharing\Permission; +use NCU\Sharing\Permission\ISharePermissionType; use OCA\Files\AppInfo\Application; use OCP\L10N\IFactory; -use OCP\Sharing\Permission\ISharePermissionType; final class NodeReadSharePermissionType implements ISharePermissionType { #[\Override] diff --git a/apps/files/lib/Sharing/Permission/NodeUpdateSharePermissionType.php b/apps/files/lib/Sharing/Permission/NodeUpdateSharePermissionType.php index 9645705916764..a4b72828c6c0e 100644 --- a/apps/files/lib/Sharing/Permission/NodeUpdateSharePermissionType.php +++ b/apps/files/lib/Sharing/Permission/NodeUpdateSharePermissionType.php @@ -9,11 +9,11 @@ namespace OCA\Files\Sharing\Permission; +use NCU\Sharing\Permission\ISharePermissionType; use OCA\Files\AppInfo\Application; use OCP\Constants; use OCP\IAppConfig; use OCP\L10N\IFactory; -use OCP\Sharing\Permission\ISharePermissionType; final readonly class NodeUpdateSharePermissionType implements ISharePermissionType { public function __construct( diff --git a/apps/files/lib/Sharing/Property/NodeGridViewSharePropertyType.php b/apps/files/lib/Sharing/Property/NodeGridViewSharePropertyType.php index d801d9cf130cd..394cddff648e4 100644 --- a/apps/files/lib/Sharing/Property/NodeGridViewSharePropertyType.php +++ b/apps/files/lib/Sharing/Property/NodeGridViewSharePropertyType.php @@ -9,10 +9,10 @@ namespace OCA\Files\Sharing\Property; +use NCU\Sharing\Property\ABooleanSharePropertyType; +use NCU\Sharing\Share; use OCA\Files\AppInfo\Application; use OCP\L10N\IFactory; -use OCP\Sharing\Property\ABooleanSharePropertyType; -use OCP\Sharing\Share; final class NodeGridViewSharePropertyType extends ABooleanSharePropertyType { #[\Override] diff --git a/apps/files/lib/Sharing/Source/NodeShareSourceType.php b/apps/files/lib/Sharing/Source/NodeShareSourceType.php index af972af00bf20..ea1a435e0223f 100644 --- a/apps/files/lib/Sharing/Source/NodeShareSourceType.php +++ b/apps/files/lib/Sharing/Source/NodeShareSourceType.php @@ -10,6 +10,11 @@ namespace OCA\Files\Sharing\Source; use Exception; +use NCU\Sharing\Icon\ShareIconURL; +use NCU\Sharing\ISharingManager; +use NCU\Sharing\ShareAccessContext; +use NCU\Sharing\Source\IShareSourceType; +use NCU\Sharing\Source\ShareSource; use OCA\Files\AppInfo\Application; use OCA\Files_Trashbin\Events\MoveToTrashEvent; use OCP\EventDispatcher\Event; @@ -23,11 +28,6 @@ use OCP\Interaction\Resources\NodeResource; use OCP\IURLGenerator; use OCP\L10N\IFactory; -use OCP\Sharing\Icon\ShareIconURL; -use OCP\Sharing\ISharingManager; -use OCP\Sharing\ShareAccessContext; -use OCP\Sharing\Source\IShareSourceType; -use OCP\Sharing\Source\ShareSource; /** * @template-implements IEventListener diff --git a/apps/files/tests/Sharing/Source/NodeShareSourceTypeTest.php b/apps/files/tests/Sharing/Source/NodeShareSourceTypeTest.php index 7eeeaa4363366..3311775b4cc7d 100644 --- a/apps/files/tests/Sharing/Source/NodeShareSourceTypeTest.php +++ b/apps/files/tests/Sharing/Source/NodeShareSourceTypeTest.php @@ -7,6 +7,10 @@ declare(strict_types=1); +use NCU\Sharing\ISharingManager; +use NCU\Sharing\ISharingRegistry; +use NCU\Sharing\ShareAccessContext; +use NCU\Sharing\Source\ShareSource; use OC\Files\Filesystem; use OC\User\Database; use OCA\Files\Sharing\Source\NodeShareSourceType; @@ -19,10 +23,6 @@ use OCP\IUser; use OCP\IUserManager; use OCP\Server; -use OCP\Sharing\ISharingManager; -use OCP\Sharing\ISharingRegistry; -use OCP\Sharing\ShareAccessContext; -use OCP\Sharing\Source\ShareSource; use PHPUnit\Framework\Attributes\Group; use Test\TestCase; diff --git a/apps/sharing/lib/AppInfo/Application.php b/apps/sharing/lib/AppInfo/Application.php index 718a088b9e1c1..0eec114787d09 100644 --- a/apps/sharing/lib/AppInfo/Application.php +++ b/apps/sharing/lib/AppInfo/Application.php @@ -9,6 +9,7 @@ namespace OCA\Sharing\AppInfo; +use NCU\Sharing\ISharingRegistry; use OCA\Sharing\Capabilities; use OCA\Sharing\Middleware\ShareApiEnabledMiddleware; use OCA\Sharing\SharingBackend; @@ -17,7 +18,6 @@ use OCP\AppFramework\Bootstrap\IBootstrap; use OCP\AppFramework\Bootstrap\IRegistrationContext; use OCP\Server; -use OCP\Sharing\ISharingRegistry; final class Application extends App implements IBootstrap { public const string APP_ID = 'sharing'; diff --git a/apps/sharing/lib/Capabilities.php b/apps/sharing/lib/Capabilities.php index a1d3f547e9d2e..2f54ecce6d550 100644 --- a/apps/sharing/lib/Capabilities.php +++ b/apps/sharing/lib/Capabilities.php @@ -9,14 +9,14 @@ namespace OCA\Sharing; +use NCU\Sharing\ISharingRegistry; +use NCU\Sharing\Permission\ISharePermissionPreset; +use NCU\Sharing\Source\IShareSourceType; use OCA\Sharing\AppInfo\Application; use OCP\Capabilities\ICapability; use OCP\L10N\IFactory; use OCP\Server; use OCP\Share\IManager; -use OCP\Sharing\ISharingRegistry; -use OCP\Sharing\Permission\ISharePermissionPreset; -use OCP\Sharing\Source\IShareSourceType; /** * @psalm-import-type SharingSourceType from ResponseDefinitions diff --git a/apps/sharing/lib/Command/AddShareRecipient.php b/apps/sharing/lib/Command/AddShareRecipient.php index 3990cf423f9e8..061103416b6d7 100644 --- a/apps/sharing/lib/Command/AddShareRecipient.php +++ b/apps/sharing/lib/Command/AddShareRecipient.php @@ -9,8 +9,8 @@ namespace OCA\Sharing\Command; -use OCP\Sharing\Recipient\IShareRecipientType; -use OCP\Sharing\Recipient\ShareRecipient; +use NCU\Sharing\Recipient\IShareRecipientType; +use NCU\Sharing\Recipient\ShareRecipient; use Symfony\Component\Console\Input\InputArgument; use Symfony\Component\Console\Input\InputInterface; use Symfony\Component\Console\Output\OutputInterface; diff --git a/apps/sharing/lib/Command/AddShareSource.php b/apps/sharing/lib/Command/AddShareSource.php index 48126f90d12af..d236c747eb774 100644 --- a/apps/sharing/lib/Command/AddShareSource.php +++ b/apps/sharing/lib/Command/AddShareSource.php @@ -9,8 +9,8 @@ namespace OCA\Sharing\Command; -use OCP\Sharing\Source\IShareSourceType; -use OCP\Sharing\Source\ShareSource; +use NCU\Sharing\Source\IShareSourceType; +use NCU\Sharing\Source\ShareSource; use Symfony\Component\Console\Input\InputArgument; use Symfony\Component\Console\Input\InputInterface; use Symfony\Component\Console\Output\OutputInterface; diff --git a/apps/sharing/lib/Command/CreateShare.php b/apps/sharing/lib/Command/CreateShare.php index 771d69976f0f7..013543f5bcc5c 100644 --- a/apps/sharing/lib/Command/CreateShare.php +++ b/apps/sharing/lib/Command/CreateShare.php @@ -9,11 +9,11 @@ namespace OCA\Sharing\Command; +use NCU\Sharing\Exception\ShareInvalidException; +use NCU\Sharing\ShareAccessContext; use OCP\IUserManager; use OCP\L10N\IFactory; use OCP\Server; -use OCP\Sharing\Exception\ShareInvalidException; -use OCP\Sharing\ShareAccessContext; use Symfony\Component\Console\Input\InputArgument; use Symfony\Component\Console\Input\InputInterface; use Symfony\Component\Console\Output\OutputInterface; diff --git a/apps/sharing/lib/Command/DeleteShare.php b/apps/sharing/lib/Command/DeleteShare.php index 86bfd286c3a54..ee99de6b01880 100644 --- a/apps/sharing/lib/Command/DeleteShare.php +++ b/apps/sharing/lib/Command/DeleteShare.php @@ -10,8 +10,8 @@ namespace OCA\Sharing\Command; use Exception; +use NCU\Sharing\Exception\AShareException; use OC\Core\Command\Base; -use OCP\Sharing\Exception\AShareException; use Symfony\Component\Console\Input\InputArgument; use Symfony\Component\Console\Input\InputInterface; use Symfony\Component\Console\Output\ConsoleOutputInterface; diff --git a/apps/sharing/lib/Command/GetShares.php b/apps/sharing/lib/Command/GetShares.php index 828c00ae6d454..09b06da9374c1 100644 --- a/apps/sharing/lib/Command/GetShares.php +++ b/apps/sharing/lib/Command/GetShares.php @@ -10,9 +10,9 @@ namespace OCA\Sharing\Command; use Exception; +use NCU\Sharing\Share; +use NCU\Sharing\Source\IShareSourceType; use OC\Core\Command\Base; -use OCP\Sharing\Share; -use OCP\Sharing\Source\IShareSourceType; use Symfony\Component\Console\Input\InputInterface; use Symfony\Component\Console\Input\InputOption; use Symfony\Component\Console\Output\OutputInterface; diff --git a/apps/sharing/lib/Command/RemoveShareRecipient.php b/apps/sharing/lib/Command/RemoveShareRecipient.php index 5a8cbb993091d..84f1fef9a0fe0 100644 --- a/apps/sharing/lib/Command/RemoveShareRecipient.php +++ b/apps/sharing/lib/Command/RemoveShareRecipient.php @@ -9,8 +9,8 @@ namespace OCA\Sharing\Command; -use OCP\Sharing\Recipient\IShareRecipientType; -use OCP\Sharing\Recipient\ShareRecipient; +use NCU\Sharing\Recipient\IShareRecipientType; +use NCU\Sharing\Recipient\ShareRecipient; use Symfony\Component\Console\Input\InputArgument; use Symfony\Component\Console\Input\InputInterface; use Symfony\Component\Console\Output\OutputInterface; diff --git a/apps/sharing/lib/Command/RemoveShareSource.php b/apps/sharing/lib/Command/RemoveShareSource.php index b8cd2eb94f8c8..cd2bab47729b4 100644 --- a/apps/sharing/lib/Command/RemoveShareSource.php +++ b/apps/sharing/lib/Command/RemoveShareSource.php @@ -9,8 +9,8 @@ namespace OCA\Sharing\Command; -use OCP\Sharing\Source\IShareSourceType; -use OCP\Sharing\Source\ShareSource; +use NCU\Sharing\Source\IShareSourceType; +use NCU\Sharing\Source\ShareSource; use Symfony\Component\Console\Input\InputArgument; use Symfony\Component\Console\Input\InputInterface; use Symfony\Component\Console\Output\OutputInterface; diff --git a/apps/sharing/lib/Command/SelectSharePermissionPreset.php b/apps/sharing/lib/Command/SelectSharePermissionPreset.php index af2b6cb4d2afd..c492fbad05693 100644 --- a/apps/sharing/lib/Command/SelectSharePermissionPreset.php +++ b/apps/sharing/lib/Command/SelectSharePermissionPreset.php @@ -9,7 +9,7 @@ namespace OCA\Sharing\Command; -use OCP\Sharing\Permission\ISharePermissionPreset; +use NCU\Sharing\Permission\ISharePermissionPreset; use Symfony\Component\Console\Input\InputArgument; use Symfony\Component\Console\Input\InputInterface; use Symfony\Component\Console\Output\OutputInterface; diff --git a/apps/sharing/lib/Command/SharingBase.php b/apps/sharing/lib/Command/SharingBase.php index c05fd0c6f43c3..bdbc3ad9f3646 100644 --- a/apps/sharing/lib/Command/SharingBase.php +++ b/apps/sharing/lib/Command/SharingBase.php @@ -11,15 +11,15 @@ use Closure; use Exception; +use NCU\Sharing\Exception\AShareException; +use NCU\Sharing\ISharingManager; +use NCU\Sharing\ISharingRegistry; +use NCU\Sharing\ShareAccessContext; use OC\Core\Command\Base; use OCP\IDBConnection; use OCP\IURLGenerator; use OCP\IUserManager; use OCP\L10N\IFactory; -use OCP\Sharing\Exception\AShareException; -use OCP\Sharing\ISharingManager; -use OCP\Sharing\ISharingRegistry; -use OCP\Sharing\ShareAccessContext; use Symfony\Component\Console\Command\Command; use Symfony\Component\Console\Output\ConsoleOutputInterface; use Symfony\Component\Console\Output\OutputInterface; diff --git a/apps/sharing/lib/Command/UpdateSharePermission.php b/apps/sharing/lib/Command/UpdateSharePermission.php index 070b636fc9f58..17e93bc107852 100644 --- a/apps/sharing/lib/Command/UpdateSharePermission.php +++ b/apps/sharing/lib/Command/UpdateSharePermission.php @@ -9,8 +9,8 @@ namespace OCA\Sharing\Command; -use OCP\Sharing\Permission\ISharePermissionType; -use OCP\Sharing\Permission\SharePermission; +use NCU\Sharing\Permission\ISharePermissionType; +use NCU\Sharing\Permission\SharePermission; use Symfony\Component\Console\Input\InputArgument; use Symfony\Component\Console\Input\InputInterface; use Symfony\Component\Console\Output\OutputInterface; diff --git a/apps/sharing/lib/Command/UpdateShareProperty.php b/apps/sharing/lib/Command/UpdateShareProperty.php index b611e4de9a4d8..38f8dc96774e1 100644 --- a/apps/sharing/lib/Command/UpdateShareProperty.php +++ b/apps/sharing/lib/Command/UpdateShareProperty.php @@ -9,8 +9,8 @@ namespace OCA\Sharing\Command; -use OCP\Sharing\Property\ISharePropertyType; -use OCP\Sharing\Property\ShareProperty; +use NCU\Sharing\Property\ISharePropertyType; +use NCU\Sharing\Property\ShareProperty; use Symfony\Component\Console\Input\InputArgument; use Symfony\Component\Console\Input\InputInterface; use Symfony\Component\Console\Output\OutputInterface; diff --git a/apps/sharing/lib/Command/UpdateShareRecipientSecret.php b/apps/sharing/lib/Command/UpdateShareRecipientSecret.php index b7bacc17868e8..4a77341fb6fc3 100644 --- a/apps/sharing/lib/Command/UpdateShareRecipientSecret.php +++ b/apps/sharing/lib/Command/UpdateShareRecipientSecret.php @@ -9,8 +9,8 @@ namespace OCA\Sharing\Command; -use OCP\Sharing\Recipient\IShareRecipientType; -use OCP\Sharing\Recipient\ShareRecipient; +use NCU\Sharing\Recipient\IShareRecipientType; +use NCU\Sharing\Recipient\ShareRecipient; use Symfony\Component\Console\Input\InputArgument; use Symfony\Component\Console\Input\InputInterface; use Symfony\Component\Console\Output\OutputInterface; diff --git a/apps/sharing/lib/Command/UpdateShareState.php b/apps/sharing/lib/Command/UpdateShareState.php index bb1578c52f8f0..f71c393e91355 100644 --- a/apps/sharing/lib/Command/UpdateShareState.php +++ b/apps/sharing/lib/Command/UpdateShareState.php @@ -9,7 +9,7 @@ namespace OCA\Sharing\Command; -use OCP\Sharing\ShareState; +use NCU\Sharing\ShareState; use Symfony\Component\Console\Input\InputArgument; use Symfony\Component\Console\Input\InputInterface; use Symfony\Component\Console\Output\OutputInterface; diff --git a/apps/sharing/lib/Controller/ApiV1Controller.php b/apps/sharing/lib/Controller/ApiV1Controller.php index fae70f610ca3a..6582beeb7ed02 100644 --- a/apps/sharing/lib/Controller/ApiV1Controller.php +++ b/apps/sharing/lib/Controller/ApiV1Controller.php @@ -10,6 +10,24 @@ namespace OCA\Sharing\Controller; use Exception; +use NCU\Sharing\Exception\ShareInvalidException; +use NCU\Sharing\Exception\ShareNotFoundException; +use NCU\Sharing\Exception\ShareOperationForbiddenException; +use NCU\Sharing\ISharingManager; +use NCU\Sharing\ISharingRegistry; +use NCU\Sharing\Permission\ISharePermissionPreset; +use NCU\Sharing\Permission\ISharePermissionType; +use NCU\Sharing\Permission\SharePermission; +use NCU\Sharing\Property\ISharePropertyType; +use NCU\Sharing\Property\ISharePropertyTypeFilter; +use NCU\Sharing\Property\ShareProperty; +use NCU\Sharing\Recipient\IShareRecipientType; +use NCU\Sharing\Recipient\ShareRecipient; +use NCU\Sharing\Share; +use NCU\Sharing\ShareAccessContext; +use NCU\Sharing\ShareState; +use NCU\Sharing\Source\IShareSourceType; +use NCU\Sharing\Source\ShareSource; use OCA\Sharing\ResponseDefinitions; use OCP\AppFramework\Http; use OCP\AppFramework\Http\Attribute\ApiRoute; @@ -23,24 +41,6 @@ use OCP\IUserManager; use OCP\IUserSession; use OCP\L10N\IFactory; -use OCP\Sharing\Exception\ShareInvalidException; -use OCP\Sharing\Exception\ShareNotFoundException; -use OCP\Sharing\Exception\ShareOperationForbiddenException; -use OCP\Sharing\ISharingManager; -use OCP\Sharing\ISharingRegistry; -use OCP\Sharing\Permission\ISharePermissionPreset; -use OCP\Sharing\Permission\ISharePermissionType; -use OCP\Sharing\Permission\SharePermission; -use OCP\Sharing\Property\ISharePropertyType; -use OCP\Sharing\Property\ISharePropertyTypeFilter; -use OCP\Sharing\Property\ShareProperty; -use OCP\Sharing\Recipient\IShareRecipientType; -use OCP\Sharing\Recipient\ShareRecipient; -use OCP\Sharing\Share; -use OCP\Sharing\ShareAccessContext; -use OCP\Sharing\ShareState; -use OCP\Sharing\Source\IShareSourceType; -use OCP\Sharing\Source\ShareSource; use RuntimeException; use ValueError; diff --git a/apps/sharing/lib/ResponseDefinitions.php b/apps/sharing/lib/ResponseDefinitions.php index 8765fa0c0a61e..34bd1e4ab44b9 100644 --- a/apps/sharing/lib/ResponseDefinitions.php +++ b/apps/sharing/lib/ResponseDefinitions.php @@ -9,14 +9,14 @@ namespace OCA\Sharing; -use OCP\Sharing\Permission\ISharePermissionPreset; -use OCP\Sharing\Permission\ISharePermissionType; -use OCP\Sharing\Property\ISharePropertyType; -use OCP\Sharing\Recipient\IShareRecipientType; -use OCP\Sharing\Source\IShareSourceType; +use NCU\Sharing\Permission\ISharePermissionPreset; +use NCU\Sharing\Permission\ISharePermissionType; +use NCU\Sharing\Property\ISharePropertyType; +use NCU\Sharing\Recipient\IShareRecipientType; +use NCU\Sharing\Source\IShareSourceType; /** - * Keep the following types in sync with lib/public/Sharing/Share.php: + * Keep the following types in sync with lib/unstable/Sharing/Share.php: * * @psalm-type SharingIconSVG = array{ * // An SVG using the currentColor value for dynamic theming. diff --git a/apps/sharing/lib/SharingBackend.php b/apps/sharing/lib/SharingBackend.php index 4448a24688460..aa196bc00ac50 100644 --- a/apps/sharing/lib/SharingBackend.php +++ b/apps/sharing/lib/SharingBackend.php @@ -10,6 +10,25 @@ namespace OCA\Sharing; use Exception; +use NCU\Sharing\Exception\ShareInvalidException; +use NCU\Sharing\Exception\ShareNotFoundException; +use NCU\Sharing\ISharingBackend; +use NCU\Sharing\ISharingManager; +use NCU\Sharing\ISharingRegistry; +use NCU\Sharing\Permission\ISharePermissionType; +use NCU\Sharing\Permission\SharePermission; +use NCU\Sharing\Property\ISharePropertyType; +use NCU\Sharing\Property\ISharePropertyTypeFilter; +use NCU\Sharing\Property\ISharePropertyTypeModifyValue; +use NCU\Sharing\Property\ShareProperty; +use NCU\Sharing\Recipient\IShareRecipientType; +use NCU\Sharing\Recipient\ShareRecipient; +use NCU\Sharing\Share; +use NCU\Sharing\ShareAccessContext; +use NCU\Sharing\ShareState; +use NCU\Sharing\ShareUser; +use NCU\Sharing\Source\IShareSourceType; +use NCU\Sharing\Source\ShareSource; use OCP\DB\QueryBuilder\IQueryBuilder; use OCP\IAppConfig; use OCP\IDBConnection; @@ -17,25 +36,6 @@ use OCP\IUser; use OCP\IUserManager; use OCP\L10N\IFactory; -use OCP\Sharing\Exception\ShareInvalidException; -use OCP\Sharing\Exception\ShareNotFoundException; -use OCP\Sharing\ISharingBackend; -use OCP\Sharing\ISharingManager; -use OCP\Sharing\ISharingRegistry; -use OCP\Sharing\Permission\ISharePermissionType; -use OCP\Sharing\Permission\SharePermission; -use OCP\Sharing\Property\ISharePropertyType; -use OCP\Sharing\Property\ISharePropertyTypeFilter; -use OCP\Sharing\Property\ISharePropertyTypeModifyValue; -use OCP\Sharing\Property\ShareProperty; -use OCP\Sharing\Recipient\IShareRecipientType; -use OCP\Sharing\Recipient\ShareRecipient; -use OCP\Sharing\Share; -use OCP\Sharing\ShareAccessContext; -use OCP\Sharing\ShareState; -use OCP\Sharing\ShareUser; -use OCP\Sharing\Source\IShareSourceType; -use OCP\Sharing\Source\ShareSource; use OCP\Snowflake\ISnowflakeGenerator; use RuntimeException; diff --git a/apps/sharing/tests/CapabilitiesTest.php b/apps/sharing/tests/CapabilitiesTest.php index 24854c202257e..a611acc2758be 100644 --- a/apps/sharing/tests/CapabilitiesTest.php +++ b/apps/sharing/tests/CapabilitiesTest.php @@ -7,10 +7,10 @@ declare(strict_types=1); +use NCU\Sharing\ISharingRegistry; use OCA\Sharing\AppInfo\Application; use OCA\Sharing\Capabilities; use OCP\Server; -use OCP\Sharing\ISharingRegistry; use PHPUnit\Framework\Attributes\Group; use Test\Sharing\TestSharePermissionPreset1; use Test\Sharing\TestSharePermissionPreset2; diff --git a/apps/sharing/tests/Command/CommandTest.php b/apps/sharing/tests/Command/CommandTest.php index 934dfdcf7a6cc..fae0f6717c181 100644 --- a/apps/sharing/tests/Command/CommandTest.php +++ b/apps/sharing/tests/Command/CommandTest.php @@ -7,6 +7,15 @@ declare(strict_types=1); +use NCU\Sharing\ISharingManager; +use NCU\Sharing\ISharingRegistry; +use NCU\Sharing\Permission\SharePermission; +use NCU\Sharing\Property\ShareProperty; +use NCU\Sharing\Recipient\ShareRecipient; +use NCU\Sharing\Share; +use NCU\Sharing\ShareAccessContext; +use NCU\Sharing\ShareState; +use NCU\Sharing\Source\ShareSource; use OC\Core\Command\Base; use OCA\Sharing\Command\AddShareRecipient; use OCA\Sharing\Command\AddShareSource; @@ -28,15 +37,6 @@ use OCP\IUserManager; use OCP\L10N\IFactory; use OCP\Server; -use OCP\Sharing\ISharingManager; -use OCP\Sharing\ISharingRegistry; -use OCP\Sharing\Permission\SharePermission; -use OCP\Sharing\Property\ShareProperty; -use OCP\Sharing\Recipient\ShareRecipient; -use OCP\Sharing\Share; -use OCP\Sharing\ShareAccessContext; -use OCP\Sharing\ShareState; -use OCP\Sharing\Source\ShareSource; use PHPUnit\Framework\Attributes\Group; use Symfony\Component\Console\Input\Input; use Symfony\Component\Console\Output\ConsoleOutput; diff --git a/apps/sharing/tests/Controller/ApiV1ControllerTest.php b/apps/sharing/tests/Controller/ApiV1ControllerTest.php index 2424aba18d1cf..447d5b95dd993 100644 --- a/apps/sharing/tests/Controller/ApiV1ControllerTest.php +++ b/apps/sharing/tests/Controller/ApiV1ControllerTest.php @@ -7,6 +7,15 @@ declare(strict_types=1); +use NCU\Sharing\ISharingManager; +use NCU\Sharing\ISharingRegistry; +use NCU\Sharing\Permission\SharePermission; +use NCU\Sharing\Property\ShareProperty; +use NCU\Sharing\Recipient\ShareRecipient; +use NCU\Sharing\Share; +use NCU\Sharing\ShareAccessContext; +use NCU\Sharing\ShareState; +use NCU\Sharing\Source\ShareSource; use OCA\Sharing\Controller\ApiV1Controller; use OCP\AppFramework\Http\DataResponse; use OCP\HintException; @@ -17,15 +26,6 @@ use OCP\IUserSession; use OCP\L10N\IFactory; use OCP\Server; -use OCP\Sharing\ISharingManager; -use OCP\Sharing\ISharingRegistry; -use OCP\Sharing\Permission\SharePermission; -use OCP\Sharing\Property\ShareProperty; -use OCP\Sharing\Recipient\ShareRecipient; -use OCP\Sharing\Share; -use OCP\Sharing\ShareAccessContext; -use OCP\Sharing\ShareState; -use OCP\Sharing\Source\ShareSource; use PHPUnit\Framework\Attributes\Group; use Test\Sharing\AbstractSharingManagerTests; diff --git a/build/psalm/NcuExperimentalChecker.php b/build/psalm/NcuExperimentalChecker.php index eaa70480ccc63..24add5359dfa4 100644 --- a/build/psalm/NcuExperimentalChecker.php +++ b/build/psalm/NcuExperimentalChecker.php @@ -27,11 +27,11 @@ public static function afterClassLikeVisit(AfterClassLikeVisitEvent $event): voi self::checkClassComment($classLike, $statementsSource); foreach ($classLike->stmts as $stmt) { - if ($stmt instanceof ClassConst) { + if ($stmt instanceof ClassConst && !$stmt->isPrivate()) { self::checkStatementComment($stmt, $statementsSource, 'constant'); } - if ($stmt instanceof ClassMethod) { + if ($stmt instanceof ClassMethod && !$stmt->isPrivate()) { self::checkStatementComment($stmt, $statementsSource, 'method'); } diff --git a/build/rector-strict.php b/build/rector-strict.php index ea694149bb3c2..db161bfd07bb0 100644 --- a/build/rector-strict.php +++ b/build/rector-strict.php @@ -39,7 +39,7 @@ $nextcloudDir . '/apps/files_sharing/tests/Listener/RestrictInteractionListenerTest.php', $nextcloudDir . '/core/Listener/RestrictInteractionListener.php', $nextcloudDir . '/tests/Core/Listener/RestrictInteractionListenerTest.php', - $nextcloudDir . '/lib/public/Sharing', + $nextcloudDir . '/lib/unstable/Sharing', $nextcloudDir . '/lib/private/Sharing', $nextcloudDir . '/tests/lib/Sharing', $nextcloudDir . '/apps/sharing', @@ -79,8 +79,8 @@ $nextcloudDir . '/apps/files_sharing/lib/Listener/RestrictInteractionListener.php', ], RemoveReturnTagIncompatibleWithNativeTypeRector::class => [ - $nextcloudDir . '/lib/public/Sharing/Property/ISharePropertyType.php', - $nextcloudDir . '/lib/public/Sharing/Property/ShareProperty.php', + $nextcloudDir . '/lib/unstable/Sharing/Property/ISharePropertyType.php', + $nextcloudDir . '/lib/unstable/Sharing/Property/ShareProperty.php', ], // `@return $this` is more specific than the native `: self` on a // non-final type; removing it breaks psalm's diff --git a/core/AppInfo/Application.php b/core/AppInfo/Application.php index 51425946a2536..50f8caba53a84 100644 --- a/core/AppInfo/Application.php +++ b/core/AppInfo/Application.php @@ -8,6 +8,7 @@ namespace OC\Core\AppInfo; +use NCU\Sharing\ISharingRegistry; use OC\Authentication\Events\RemoteWipeFinished; use OC\Authentication\Events\RemoteWipeStarted; use OC\Authentication\Listeners\RemoteWipeActivityListener; @@ -52,7 +53,6 @@ use OCP\Interaction\RestrictInteractionEvent; use OCP\Navigation\Events\LoadAdditionalEntriesEvent; use OCP\Server; -use OCP\Sharing\ISharingRegistry; use OCP\User\Events\BeforeUserDeletedEvent; use OCP\User\Events\PasswordUpdatedEvent; use OCP\User\Events\UserDeletedEvent; diff --git a/core/Sharing/Permission/EditSharePermissionPreset.php b/core/Sharing/Permission/EditSharePermissionPreset.php index 2ae47c28e729d..ce0bfbc49e585 100644 --- a/core/Sharing/Permission/EditSharePermissionPreset.php +++ b/core/Sharing/Permission/EditSharePermissionPreset.php @@ -9,9 +9,9 @@ namespace OC\Core\Sharing\Permission; +use NCU\Sharing\Permission\ISharePermissionPreset; use OC\Core\AppInfo\Application; use OCP\L10N\IFactory; -use OCP\Sharing\Permission\ISharePermissionPreset; final class EditSharePermissionPreset implements ISharePermissionPreset { #[\Override] diff --git a/core/Sharing/Permission/ReshareSharePermissionType.php b/core/Sharing/Permission/ReshareSharePermissionType.php index 1100571169c3b..baca4d60a7194 100644 --- a/core/Sharing/Permission/ReshareSharePermissionType.php +++ b/core/Sharing/Permission/ReshareSharePermissionType.php @@ -9,11 +9,11 @@ namespace OC\Core\Sharing\Permission; +use NCU\Sharing\Permission\ISharePermissionType; use OC\Core\AppInfo\Application; use OCP\Constants; use OCP\IAppConfig; use OCP\L10N\IFactory; -use OCP\Sharing\Permission\ISharePermissionType; final readonly class ReshareSharePermissionType implements ISharePermissionType { public function __construct( diff --git a/core/Sharing/Permission/ViewSharePermissionPreset.php b/core/Sharing/Permission/ViewSharePermissionPreset.php index ffd3693c15e4a..029e2fa29c2b5 100644 --- a/core/Sharing/Permission/ViewSharePermissionPreset.php +++ b/core/Sharing/Permission/ViewSharePermissionPreset.php @@ -9,9 +9,9 @@ namespace OC\Core\Sharing\Permission; +use NCU\Sharing\Permission\ISharePermissionPreset; use OC\Core\AppInfo\Application; use OCP\L10N\IFactory; -use OCP\Sharing\Permission\ISharePermissionPreset; // TODO: Add integration test to check that all default values result in the view preset being selected for new shares final class ViewSharePermissionPreset implements ISharePermissionPreset { diff --git a/core/Sharing/Property/ExpirationDateSharePropertyType.php b/core/Sharing/Property/ExpirationDateSharePropertyType.php index 0bd213c607539..0794ba0d6994f 100644 --- a/core/Sharing/Property/ExpirationDateSharePropertyType.php +++ b/core/Sharing/Property/ExpirationDateSharePropertyType.php @@ -12,15 +12,15 @@ use DateInterval; use DateTimeImmutable; use DateTimeInterface; +use NCU\Sharing\Property\ADateSharePropertyType; +use NCU\Sharing\Property\ISharePropertyTypeFilter; +use NCU\Sharing\Share; +use NCU\Sharing\ShareAccessContext; use OC\Core\AppInfo\Application; use OC\Core\Sharing\Recipient\EmailShareRecipientType; use OC\Core\Sharing\Recipient\TokenShareRecipientType; use OCP\L10N\IFactory; use OCP\Share\IManager; -use OCP\Sharing\Property\ADateSharePropertyType; -use OCP\Sharing\Property\ISharePropertyTypeFilter; -use OCP\Sharing\Share; -use OCP\Sharing\ShareAccessContext; use RuntimeException; // TODO: Handle per recipient required and default flags. diff --git a/core/Sharing/Property/LabelSharePropertyType.php b/core/Sharing/Property/LabelSharePropertyType.php index b3cb93beb551e..bcfea2ca075ef 100644 --- a/core/Sharing/Property/LabelSharePropertyType.php +++ b/core/Sharing/Property/LabelSharePropertyType.php @@ -9,10 +9,10 @@ namespace OC\Core\Sharing\Property; +use NCU\Sharing\Property\AStringSharePropertyType; +use NCU\Sharing\Share; use OC\Core\AppInfo\Application; use OCP\L10N\IFactory; -use OCP\Sharing\Property\AStringSharePropertyType; -use OCP\Sharing\Share; final class LabelSharePropertyType extends AStringSharePropertyType { #[\Override] diff --git a/core/Sharing/Property/NoteSharePropertyType.php b/core/Sharing/Property/NoteSharePropertyType.php index 04735a90562bd..e4902eaeb62ca 100644 --- a/core/Sharing/Property/NoteSharePropertyType.php +++ b/core/Sharing/Property/NoteSharePropertyType.php @@ -9,10 +9,10 @@ namespace OC\Core\Sharing\Property; +use NCU\Sharing\Property\AStringSharePropertyType; +use NCU\Sharing\Share; use OC\Core\AppInfo\Application; use OCP\L10N\IFactory; -use OCP\Sharing\Property\AStringSharePropertyType; -use OCP\Sharing\Share; final class NoteSharePropertyType extends AStringSharePropertyType { #[\Override] diff --git a/core/Sharing/Property/PasswordSharePropertyType.php b/core/Sharing/Property/PasswordSharePropertyType.php index 190d4cde6e2c9..7efb38f4c970e 100644 --- a/core/Sharing/Property/PasswordSharePropertyType.php +++ b/core/Sharing/Property/PasswordSharePropertyType.php @@ -9,6 +9,10 @@ namespace OC\Core\Sharing\Property; +use NCU\Sharing\Property\APasswordSharePropertyType; +use NCU\Sharing\Property\ISharePropertyTypeFilter; +use NCU\Sharing\Share; +use NCU\Sharing\ShareAccessContext; use OC\Core\AppInfo\Application; use OCP\EventDispatcher\IEventDispatcher; use OCP\L10N\IFactory; @@ -17,10 +21,6 @@ use OCP\Security\ISecureRandom; use OCP\Security\PasswordContext; use OCP\Share\IManager; -use OCP\Sharing\Property\APasswordSharePropertyType; -use OCP\Sharing\Property\ISharePropertyTypeFilter; -use OCP\Sharing\Share; -use OCP\Sharing\ShareAccessContext; use Random\Randomizer; final class PasswordSharePropertyType extends APasswordSharePropertyType implements ISharePropertyTypeFilter { diff --git a/core/Sharing/Recipient/EmailShareRecipientType.php b/core/Sharing/Recipient/EmailShareRecipientType.php index 82d1a77cc739e..86bda3614d7d7 100644 --- a/core/Sharing/Recipient/EmailShareRecipientType.php +++ b/core/Sharing/Recipient/EmailShareRecipientType.php @@ -9,6 +9,9 @@ namespace OC\Core\Sharing\Recipient; +use NCU\Sharing\Icon\ShareIconSVG; +use NCU\Sharing\Icon\ShareIconURL; +use NCU\Sharing\Recipient\AShareRecipientTypeSearchCollaborator; use OC\Core\AppInfo\Application; use OCP\Interaction\InteractionReceiver; use OCP\Interaction\Receivers\EmailReceiver; @@ -16,9 +19,6 @@ use OCP\L10N\IFactory; use OCP\Mail\IEmailValidator; use OCP\Share\IShare; -use OCP\Sharing\Icon\ShareIconSVG; -use OCP\Sharing\Icon\ShareIconURL; -use OCP\Sharing\Recipient\AShareRecipientTypeSearchCollaborator; // TODO: Add logic to send emails when share state is updated to active diff --git a/core/Sharing/Recipient/GroupShareRecipientType.php b/core/Sharing/Recipient/GroupShareRecipientType.php index c1c3970dd4695..d2539c72399b2 100644 --- a/core/Sharing/Recipient/GroupShareRecipientType.php +++ b/core/Sharing/Recipient/GroupShareRecipientType.php @@ -10,6 +10,12 @@ namespace OC\Core\Sharing\Recipient; use Exception; +use NCU\Sharing\Icon\ShareIconSVG; +use NCU\Sharing\Icon\ShareIconURL; +use NCU\Sharing\ISharingManager; +use NCU\Sharing\Recipient\AShareRecipientTypeSearchCollaborator; +use NCU\Sharing\Recipient\ShareRecipient; +use NCU\Sharing\ShareAccessContext; use OC\Core\AppInfo\Application; use OCP\EventDispatcher\Event; use OCP\EventDispatcher\IEventDispatcher; @@ -22,12 +28,6 @@ use OCP\IUser; use OCP\L10N\IFactory; use OCP\Share\IShare; -use OCP\Sharing\Icon\ShareIconSVG; -use OCP\Sharing\Icon\ShareIconURL; -use OCP\Sharing\ISharingManager; -use OCP\Sharing\Recipient\AShareRecipientTypeSearchCollaborator; -use OCP\Sharing\Recipient\ShareRecipient; -use OCP\Sharing\ShareAccessContext; /** * @template-implements IEventListener diff --git a/core/Sharing/Recipient/TeamShareRecipientType.php b/core/Sharing/Recipient/TeamShareRecipientType.php index 9c3867aa02e96..0f7638e4e15be 100644 --- a/core/Sharing/Recipient/TeamShareRecipientType.php +++ b/core/Sharing/Recipient/TeamShareRecipientType.php @@ -10,6 +10,12 @@ namespace OC\Core\Sharing\Recipient; use Exception; +use NCU\Sharing\Icon\ShareIconSVG; +use NCU\Sharing\Icon\ShareIconURL; +use NCU\Sharing\ISharingManager; +use NCU\Sharing\Recipient\AShareRecipientTypeSearchCollaborator; +use NCU\Sharing\Recipient\ShareRecipient; +use NCU\Sharing\ShareAccessContext; use OC\Core\AppInfo\Application; use OCA\Circles\Events\DestroyingCircleEvent; use OCP\EventDispatcher\Event; @@ -22,12 +28,6 @@ use OCP\L10N\IFactory; use OCP\Server; use OCP\Share\IShare; -use OCP\Sharing\Icon\ShareIconSVG; -use OCP\Sharing\Icon\ShareIconURL; -use OCP\Sharing\ISharingManager; -use OCP\Sharing\Recipient\AShareRecipientTypeSearchCollaborator; -use OCP\Sharing\Recipient\ShareRecipient; -use OCP\Sharing\ShareAccessContext; use OCP\Teams\ITeamManager; use OCP\Teams\Team; diff --git a/core/Sharing/Recipient/TokenShareRecipientType.php b/core/Sharing/Recipient/TokenShareRecipientType.php index 1ddebc7d25e5b..6cacd0cdc8188 100644 --- a/core/Sharing/Recipient/TokenShareRecipientType.php +++ b/core/Sharing/Recipient/TokenShareRecipientType.php @@ -9,16 +9,16 @@ namespace OC\Core\Sharing\Recipient; +use NCU\Sharing\Icon\ShareIconSVG; +use NCU\Sharing\Icon\ShareIconURL; +use NCU\Sharing\Recipient\IShareRecipientType; +use NCU\Sharing\Recipient\IShareRecipientTypePublicSecret; use OC\Core\AppInfo\Application; use OCP\Interaction\InteractionReceiver; use OCP\Interaction\Receivers\LinkReceiver; use OCP\IUser; use OCP\L10N\IFactory; use OCP\Share\IManager; -use OCP\Sharing\Icon\ShareIconSVG; -use OCP\Sharing\Icon\ShareIconURL; -use OCP\Sharing\Recipient\IShareRecipientType; -use OCP\Sharing\Recipient\IShareRecipientTypePublicSecret; // TODO: Rename to Link? final readonly class TokenShareRecipientType implements IShareRecipientType, IShareRecipientTypePublicSecret { diff --git a/core/Sharing/Recipient/UserShareRecipientType.php b/core/Sharing/Recipient/UserShareRecipientType.php index 29b8410af4245..3c69a7ab804b1 100644 --- a/core/Sharing/Recipient/UserShareRecipientType.php +++ b/core/Sharing/Recipient/UserShareRecipientType.php @@ -10,6 +10,11 @@ namespace OC\Core\Sharing\Recipient; use Exception; +use NCU\Sharing\Icon\ShareIconURL; +use NCU\Sharing\ISharingManager; +use NCU\Sharing\Recipient\AShareRecipientTypeSearchCollaborator; +use NCU\Sharing\Recipient\ShareRecipient; +use NCU\Sharing\ShareAccessContext; use OC\Core\AppInfo\Application; use OCP\EventDispatcher\Event; use OCP\EventDispatcher\IEventDispatcher; @@ -21,11 +26,6 @@ use OCP\IUserManager; use OCP\L10N\IFactory; use OCP\Share\IShare; -use OCP\Sharing\Icon\ShareIconURL; -use OCP\Sharing\ISharingManager; -use OCP\Sharing\Recipient\AShareRecipientTypeSearchCollaborator; -use OCP\Sharing\Recipient\ShareRecipient; -use OCP\Sharing\ShareAccessContext; use OCP\User\Events\UserDeletedEvent; /** diff --git a/lib/composer/composer/autoload_classmap.php b/lib/composer/composer/autoload_classmap.php index beafb4700c69d..c58f6a0ed305d 100644 --- a/lib/composer/composer/autoload_classmap.php +++ b/lib/composer/composer/autoload_classmap.php @@ -37,6 +37,38 @@ 'NCU\\Security\\Signature\\ISignatureManager' => $baseDir . '/lib/unstable/Security/Signature/ISignatureManager.php', 'NCU\\Security\\Signature\\ISignedRequest' => $baseDir . '/lib/unstable/Security/Signature/ISignedRequest.php', 'NCU\\Security\\Signature\\Model\\Signatory' => $baseDir . '/lib/unstable/Security/Signature/Model/Signatory.php', + 'NCU\\Sharing\\Exception\\AShareException' => $baseDir . '/lib/unstable/Sharing/Exception/AShareException.php', + 'NCU\\Sharing\\Exception\\ShareInvalidException' => $baseDir . '/lib/unstable/Sharing/Exception/ShareInvalidException.php', + 'NCU\\Sharing\\Exception\\ShareNotFoundException' => $baseDir . '/lib/unstable/Sharing/Exception/ShareNotFoundException.php', + 'NCU\\Sharing\\Exception\\ShareOperationForbiddenException' => $baseDir . '/lib/unstable/Sharing/Exception/ShareOperationForbiddenException.php', + 'NCU\\Sharing\\ISharingBackend' => $baseDir . '/lib/unstable/Sharing/ISharingBackend.php', + 'NCU\\Sharing\\ISharingManager' => $baseDir . '/lib/unstable/Sharing/ISharingManager.php', + 'NCU\\Sharing\\ISharingRegistry' => $baseDir . '/lib/unstable/Sharing/ISharingRegistry.php', + 'NCU\\Sharing\\Icon\\ShareIconSVG' => $baseDir . '/lib/unstable/Sharing/Icon/ShareIconSVG.php', + 'NCU\\Sharing\\Icon\\ShareIconURL' => $baseDir . '/lib/unstable/Sharing/Icon/ShareIconURL.php', + 'NCU\\Sharing\\Permission\\ISharePermissionPreset' => $baseDir . '/lib/unstable/Sharing/Permission/ISharePermissionPreset.php', + 'NCU\\Sharing\\Permission\\ISharePermissionType' => $baseDir . '/lib/unstable/Sharing/Permission/ISharePermissionType.php', + 'NCU\\Sharing\\Permission\\SharePermission' => $baseDir . '/lib/unstable/Sharing/Permission/SharePermission.php', + 'NCU\\Sharing\\Property\\ABooleanSharePropertyType' => $baseDir . '/lib/unstable/Sharing/Property/ABooleanSharePropertyType.php', + 'NCU\\Sharing\\Property\\ADateSharePropertyType' => $baseDir . '/lib/unstable/Sharing/Property/ADateSharePropertyType.php', + 'NCU\\Sharing\\Property\\AEnumSharePropertyType' => $baseDir . '/lib/unstable/Sharing/Property/AEnumSharePropertyType.php', + 'NCU\\Sharing\\Property\\APasswordSharePropertyType' => $baseDir . '/lib/unstable/Sharing/Property/APasswordSharePropertyType.php', + 'NCU\\Sharing\\Property\\AStringSharePropertyType' => $baseDir . '/lib/unstable/Sharing/Property/AStringSharePropertyType.php', + 'NCU\\Sharing\\Property\\ISharePropertyType' => $baseDir . '/lib/unstable/Sharing/Property/ISharePropertyType.php', + 'NCU\\Sharing\\Property\\ISharePropertyTypeFilter' => $baseDir . '/lib/unstable/Sharing/Property/ISharePropertyTypeFilter.php', + 'NCU\\Sharing\\Property\\ISharePropertyTypeModifyValue' => $baseDir . '/lib/unstable/Sharing/Property/ISharePropertyTypeModifyValue.php', + 'NCU\\Sharing\\Property\\ShareProperty' => $baseDir . '/lib/unstable/Sharing/Property/ShareProperty.php', + 'NCU\\Sharing\\Recipient\\AShareRecipientTypeSearchCollaborator' => $baseDir . '/lib/unstable/Sharing/Recipient/AShareRecipientTypeSearchCollaborator.php', + 'NCU\\Sharing\\Recipient\\IShareRecipientType' => $baseDir . '/lib/unstable/Sharing/Recipient/IShareRecipientType.php', + 'NCU\\Sharing\\Recipient\\IShareRecipientTypePublicSecret' => $baseDir . '/lib/unstable/Sharing/Recipient/IShareRecipientTypePublicSecret.php', + 'NCU\\Sharing\\Recipient\\IShareRecipientTypeSearch' => $baseDir . '/lib/unstable/Sharing/Recipient/IShareRecipientTypeSearch.php', + 'NCU\\Sharing\\Recipient\\ShareRecipient' => $baseDir . '/lib/unstable/Sharing/Recipient/ShareRecipient.php', + 'NCU\\Sharing\\Share' => $baseDir . '/lib/unstable/Sharing/Share.php', + 'NCU\\Sharing\\ShareAccessContext' => $baseDir . '/lib/unstable/Sharing/ShareAccessContext.php', + 'NCU\\Sharing\\ShareState' => $baseDir . '/lib/unstable/Sharing/ShareState.php', + 'NCU\\Sharing\\ShareUser' => $baseDir . '/lib/unstable/Sharing/ShareUser.php', + 'NCU\\Sharing\\Source\\IShareSourceType' => $baseDir . '/lib/unstable/Sharing/Source/IShareSourceType.php', + 'NCU\\Sharing\\Source\\ShareSource' => $baseDir . '/lib/unstable/Sharing/Source/ShareSource.php', 'NCU\\WorkflowEngine\\Events\\RegisterRuntimeOperationsEvent' => $baseDir . '/lib/unstable/WorkflowEngine/Events/RegisterRuntimeOperationsEvent.php', 'NCU\\WorkflowEngine\\RuntimeOperation' => $baseDir . '/lib/unstable/WorkflowEngine/RuntimeOperation.php', 'NCU\\WorkflowEngine\\RuntimeScope' => $baseDir . '/lib/unstable/WorkflowEngine/RuntimeScope.php', @@ -897,38 +929,6 @@ 'OCP\\Share\\ShareReview\\RegisterShareReviewSourceEvent' => $baseDir . '/lib/public/Share/ShareReview/RegisterShareReviewSourceEvent.php', 'OCP\\Share\\ShareReview\\ShareReviewEntry' => $baseDir . '/lib/public/Share/ShareReview/ShareReviewEntry.php', 'OCP\\Share\\ShareReview\\ShareReviewPermission' => $baseDir . '/lib/public/Share/ShareReview/ShareReviewPermission.php', - 'OCP\\Sharing\\Exception\\AShareException' => $baseDir . '/lib/public/Sharing/Exception/AShareException.php', - 'OCP\\Sharing\\Exception\\ShareInvalidException' => $baseDir . '/lib/public/Sharing/Exception/ShareInvalidException.php', - 'OCP\\Sharing\\Exception\\ShareNotFoundException' => $baseDir . '/lib/public/Sharing/Exception/ShareNotFoundException.php', - 'OCP\\Sharing\\Exception\\ShareOperationForbiddenException' => $baseDir . '/lib/public/Sharing/Exception/ShareOperationForbiddenException.php', - 'OCP\\Sharing\\ISharingBackend' => $baseDir . '/lib/public/Sharing/ISharingBackend.php', - 'OCP\\Sharing\\ISharingManager' => $baseDir . '/lib/public/Sharing/ISharingManager.php', - 'OCP\\Sharing\\ISharingRegistry' => $baseDir . '/lib/public/Sharing/ISharingRegistry.php', - 'OCP\\Sharing\\Icon\\ShareIconSVG' => $baseDir . '/lib/public/Sharing/Icon/ShareIconSVG.php', - 'OCP\\Sharing\\Icon\\ShareIconURL' => $baseDir . '/lib/public/Sharing/Icon/ShareIconURL.php', - 'OCP\\Sharing\\Permission\\ISharePermissionPreset' => $baseDir . '/lib/public/Sharing/Permission/ISharePermissionPreset.php', - 'OCP\\Sharing\\Permission\\ISharePermissionType' => $baseDir . '/lib/public/Sharing/Permission/ISharePermissionType.php', - 'OCP\\Sharing\\Permission\\SharePermission' => $baseDir . '/lib/public/Sharing/Permission/SharePermission.php', - 'OCP\\Sharing\\Property\\ABooleanSharePropertyType' => $baseDir . '/lib/public/Sharing/Property/ABooleanSharePropertyType.php', - 'OCP\\Sharing\\Property\\ADateSharePropertyType' => $baseDir . '/lib/public/Sharing/Property/ADateSharePropertyType.php', - 'OCP\\Sharing\\Property\\AEnumSharePropertyType' => $baseDir . '/lib/public/Sharing/Property/AEnumSharePropertyType.php', - 'OCP\\Sharing\\Property\\APasswordSharePropertyType' => $baseDir . '/lib/public/Sharing/Property/APasswordSharePropertyType.php', - 'OCP\\Sharing\\Property\\AStringSharePropertyType' => $baseDir . '/lib/public/Sharing/Property/AStringSharePropertyType.php', - 'OCP\\Sharing\\Property\\ISharePropertyType' => $baseDir . '/lib/public/Sharing/Property/ISharePropertyType.php', - 'OCP\\Sharing\\Property\\ISharePropertyTypeFilter' => $baseDir . '/lib/public/Sharing/Property/ISharePropertyTypeFilter.php', - 'OCP\\Sharing\\Property\\ISharePropertyTypeModifyValue' => $baseDir . '/lib/public/Sharing/Property/ISharePropertyTypeModifyValue.php', - 'OCP\\Sharing\\Property\\ShareProperty' => $baseDir . '/lib/public/Sharing/Property/ShareProperty.php', - 'OCP\\Sharing\\Recipient\\AShareRecipientTypeSearchCollaborator' => $baseDir . '/lib/public/Sharing/Recipient/AShareRecipientTypeSearchCollaborator.php', - 'OCP\\Sharing\\Recipient\\IShareRecipientType' => $baseDir . '/lib/public/Sharing/Recipient/IShareRecipientType.php', - 'OCP\\Sharing\\Recipient\\IShareRecipientTypePublicSecret' => $baseDir . '/lib/public/Sharing/Recipient/IShareRecipientTypePublicSecret.php', - 'OCP\\Sharing\\Recipient\\IShareRecipientTypeSearch' => $baseDir . '/lib/public/Sharing/Recipient/IShareRecipientTypeSearch.php', - 'OCP\\Sharing\\Recipient\\ShareRecipient' => $baseDir . '/lib/public/Sharing/Recipient/ShareRecipient.php', - 'OCP\\Sharing\\Share' => $baseDir . '/lib/public/Sharing/Share.php', - 'OCP\\Sharing\\ShareAccessContext' => $baseDir . '/lib/public/Sharing/ShareAccessContext.php', - 'OCP\\Sharing\\ShareState' => $baseDir . '/lib/public/Sharing/ShareState.php', - 'OCP\\Sharing\\ShareUser' => $baseDir . '/lib/public/Sharing/ShareUser.php', - 'OCP\\Sharing\\Source\\IShareSourceType' => $baseDir . '/lib/public/Sharing/Source/IShareSourceType.php', - 'OCP\\Sharing\\Source\\ShareSource' => $baseDir . '/lib/public/Sharing/Source/ShareSource.php', 'OCP\\Snowflake\\ISnowflakeDecoder' => $baseDir . '/lib/public/Snowflake/ISnowflakeDecoder.php', 'OCP\\Snowflake\\ISnowflakeGenerator' => $baseDir . '/lib/public/Snowflake/ISnowflakeGenerator.php', 'OCP\\Snowflake\\Snowflake' => $baseDir . '/lib/public/Snowflake/Snowflake.php', diff --git a/lib/composer/composer/autoload_static.php b/lib/composer/composer/autoload_static.php index e024c1fb44b9f..32e4ffee59a32 100644 --- a/lib/composer/composer/autoload_static.php +++ b/lib/composer/composer/autoload_static.php @@ -78,6 +78,38 @@ class ComposerStaticInit749170dad3f5e7f9ca158f5a9f04f6a2 'NCU\\Security\\Signature\\ISignatureManager' => __DIR__ . '/../../..' . '/lib/unstable/Security/Signature/ISignatureManager.php', 'NCU\\Security\\Signature\\ISignedRequest' => __DIR__ . '/../../..' . '/lib/unstable/Security/Signature/ISignedRequest.php', 'NCU\\Security\\Signature\\Model\\Signatory' => __DIR__ . '/../../..' . '/lib/unstable/Security/Signature/Model/Signatory.php', + 'NCU\\Sharing\\Exception\\AShareException' => __DIR__ . '/../../..' . '/lib/unstable/Sharing/Exception/AShareException.php', + 'NCU\\Sharing\\Exception\\ShareInvalidException' => __DIR__ . '/../../..' . '/lib/unstable/Sharing/Exception/ShareInvalidException.php', + 'NCU\\Sharing\\Exception\\ShareNotFoundException' => __DIR__ . '/../../..' . '/lib/unstable/Sharing/Exception/ShareNotFoundException.php', + 'NCU\\Sharing\\Exception\\ShareOperationForbiddenException' => __DIR__ . '/../../..' . '/lib/unstable/Sharing/Exception/ShareOperationForbiddenException.php', + 'NCU\\Sharing\\ISharingBackend' => __DIR__ . '/../../..' . '/lib/unstable/Sharing/ISharingBackend.php', + 'NCU\\Sharing\\ISharingManager' => __DIR__ . '/../../..' . '/lib/unstable/Sharing/ISharingManager.php', + 'NCU\\Sharing\\ISharingRegistry' => __DIR__ . '/../../..' . '/lib/unstable/Sharing/ISharingRegistry.php', + 'NCU\\Sharing\\Icon\\ShareIconSVG' => __DIR__ . '/../../..' . '/lib/unstable/Sharing/Icon/ShareIconSVG.php', + 'NCU\\Sharing\\Icon\\ShareIconURL' => __DIR__ . '/../../..' . '/lib/unstable/Sharing/Icon/ShareIconURL.php', + 'NCU\\Sharing\\Permission\\ISharePermissionPreset' => __DIR__ . '/../../..' . '/lib/unstable/Sharing/Permission/ISharePermissionPreset.php', + 'NCU\\Sharing\\Permission\\ISharePermissionType' => __DIR__ . '/../../..' . '/lib/unstable/Sharing/Permission/ISharePermissionType.php', + 'NCU\\Sharing\\Permission\\SharePermission' => __DIR__ . '/../../..' . '/lib/unstable/Sharing/Permission/SharePermission.php', + 'NCU\\Sharing\\Property\\ABooleanSharePropertyType' => __DIR__ . '/../../..' . '/lib/unstable/Sharing/Property/ABooleanSharePropertyType.php', + 'NCU\\Sharing\\Property\\ADateSharePropertyType' => __DIR__ . '/../../..' . '/lib/unstable/Sharing/Property/ADateSharePropertyType.php', + 'NCU\\Sharing\\Property\\AEnumSharePropertyType' => __DIR__ . '/../../..' . '/lib/unstable/Sharing/Property/AEnumSharePropertyType.php', + 'NCU\\Sharing\\Property\\APasswordSharePropertyType' => __DIR__ . '/../../..' . '/lib/unstable/Sharing/Property/APasswordSharePropertyType.php', + 'NCU\\Sharing\\Property\\AStringSharePropertyType' => __DIR__ . '/../../..' . '/lib/unstable/Sharing/Property/AStringSharePropertyType.php', + 'NCU\\Sharing\\Property\\ISharePropertyType' => __DIR__ . '/../../..' . '/lib/unstable/Sharing/Property/ISharePropertyType.php', + 'NCU\\Sharing\\Property\\ISharePropertyTypeFilter' => __DIR__ . '/../../..' . '/lib/unstable/Sharing/Property/ISharePropertyTypeFilter.php', + 'NCU\\Sharing\\Property\\ISharePropertyTypeModifyValue' => __DIR__ . '/../../..' . '/lib/unstable/Sharing/Property/ISharePropertyTypeModifyValue.php', + 'NCU\\Sharing\\Property\\ShareProperty' => __DIR__ . '/../../..' . '/lib/unstable/Sharing/Property/ShareProperty.php', + 'NCU\\Sharing\\Recipient\\AShareRecipientTypeSearchCollaborator' => __DIR__ . '/../../..' . '/lib/unstable/Sharing/Recipient/AShareRecipientTypeSearchCollaborator.php', + 'NCU\\Sharing\\Recipient\\IShareRecipientType' => __DIR__ . '/../../..' . '/lib/unstable/Sharing/Recipient/IShareRecipientType.php', + 'NCU\\Sharing\\Recipient\\IShareRecipientTypePublicSecret' => __DIR__ . '/../../..' . '/lib/unstable/Sharing/Recipient/IShareRecipientTypePublicSecret.php', + 'NCU\\Sharing\\Recipient\\IShareRecipientTypeSearch' => __DIR__ . '/../../..' . '/lib/unstable/Sharing/Recipient/IShareRecipientTypeSearch.php', + 'NCU\\Sharing\\Recipient\\ShareRecipient' => __DIR__ . '/../../..' . '/lib/unstable/Sharing/Recipient/ShareRecipient.php', + 'NCU\\Sharing\\Share' => __DIR__ . '/../../..' . '/lib/unstable/Sharing/Share.php', + 'NCU\\Sharing\\ShareAccessContext' => __DIR__ . '/../../..' . '/lib/unstable/Sharing/ShareAccessContext.php', + 'NCU\\Sharing\\ShareState' => __DIR__ . '/../../..' . '/lib/unstable/Sharing/ShareState.php', + 'NCU\\Sharing\\ShareUser' => __DIR__ . '/../../..' . '/lib/unstable/Sharing/ShareUser.php', + 'NCU\\Sharing\\Source\\IShareSourceType' => __DIR__ . '/../../..' . '/lib/unstable/Sharing/Source/IShareSourceType.php', + 'NCU\\Sharing\\Source\\ShareSource' => __DIR__ . '/../../..' . '/lib/unstable/Sharing/Source/ShareSource.php', 'NCU\\WorkflowEngine\\Events\\RegisterRuntimeOperationsEvent' => __DIR__ . '/../../..' . '/lib/unstable/WorkflowEngine/Events/RegisterRuntimeOperationsEvent.php', 'NCU\\WorkflowEngine\\RuntimeOperation' => __DIR__ . '/../../..' . '/lib/unstable/WorkflowEngine/RuntimeOperation.php', 'NCU\\WorkflowEngine\\RuntimeScope' => __DIR__ . '/../../..' . '/lib/unstable/WorkflowEngine/RuntimeScope.php', @@ -938,38 +970,6 @@ class ComposerStaticInit749170dad3f5e7f9ca158f5a9f04f6a2 'OCP\\Share\\ShareReview\\RegisterShareReviewSourceEvent' => __DIR__ . '/../../..' . '/lib/public/Share/ShareReview/RegisterShareReviewSourceEvent.php', 'OCP\\Share\\ShareReview\\ShareReviewEntry' => __DIR__ . '/../../..' . '/lib/public/Share/ShareReview/ShareReviewEntry.php', 'OCP\\Share\\ShareReview\\ShareReviewPermission' => __DIR__ . '/../../..' . '/lib/public/Share/ShareReview/ShareReviewPermission.php', - 'OCP\\Sharing\\Exception\\AShareException' => __DIR__ . '/../../..' . '/lib/public/Sharing/Exception/AShareException.php', - 'OCP\\Sharing\\Exception\\ShareInvalidException' => __DIR__ . '/../../..' . '/lib/public/Sharing/Exception/ShareInvalidException.php', - 'OCP\\Sharing\\Exception\\ShareNotFoundException' => __DIR__ . '/../../..' . '/lib/public/Sharing/Exception/ShareNotFoundException.php', - 'OCP\\Sharing\\Exception\\ShareOperationForbiddenException' => __DIR__ . '/../../..' . '/lib/public/Sharing/Exception/ShareOperationForbiddenException.php', - 'OCP\\Sharing\\ISharingBackend' => __DIR__ . '/../../..' . '/lib/public/Sharing/ISharingBackend.php', - 'OCP\\Sharing\\ISharingManager' => __DIR__ . '/../../..' . '/lib/public/Sharing/ISharingManager.php', - 'OCP\\Sharing\\ISharingRegistry' => __DIR__ . '/../../..' . '/lib/public/Sharing/ISharingRegistry.php', - 'OCP\\Sharing\\Icon\\ShareIconSVG' => __DIR__ . '/../../..' . '/lib/public/Sharing/Icon/ShareIconSVG.php', - 'OCP\\Sharing\\Icon\\ShareIconURL' => __DIR__ . '/../../..' . '/lib/public/Sharing/Icon/ShareIconURL.php', - 'OCP\\Sharing\\Permission\\ISharePermissionPreset' => __DIR__ . '/../../..' . '/lib/public/Sharing/Permission/ISharePermissionPreset.php', - 'OCP\\Sharing\\Permission\\ISharePermissionType' => __DIR__ . '/../../..' . '/lib/public/Sharing/Permission/ISharePermissionType.php', - 'OCP\\Sharing\\Permission\\SharePermission' => __DIR__ . '/../../..' . '/lib/public/Sharing/Permission/SharePermission.php', - 'OCP\\Sharing\\Property\\ABooleanSharePropertyType' => __DIR__ . '/../../..' . '/lib/public/Sharing/Property/ABooleanSharePropertyType.php', - 'OCP\\Sharing\\Property\\ADateSharePropertyType' => __DIR__ . '/../../..' . '/lib/public/Sharing/Property/ADateSharePropertyType.php', - 'OCP\\Sharing\\Property\\AEnumSharePropertyType' => __DIR__ . '/../../..' . '/lib/public/Sharing/Property/AEnumSharePropertyType.php', - 'OCP\\Sharing\\Property\\APasswordSharePropertyType' => __DIR__ . '/../../..' . '/lib/public/Sharing/Property/APasswordSharePropertyType.php', - 'OCP\\Sharing\\Property\\AStringSharePropertyType' => __DIR__ . '/../../..' . '/lib/public/Sharing/Property/AStringSharePropertyType.php', - 'OCP\\Sharing\\Property\\ISharePropertyType' => __DIR__ . '/../../..' . '/lib/public/Sharing/Property/ISharePropertyType.php', - 'OCP\\Sharing\\Property\\ISharePropertyTypeFilter' => __DIR__ . '/../../..' . '/lib/public/Sharing/Property/ISharePropertyTypeFilter.php', - 'OCP\\Sharing\\Property\\ISharePropertyTypeModifyValue' => __DIR__ . '/../../..' . '/lib/public/Sharing/Property/ISharePropertyTypeModifyValue.php', - 'OCP\\Sharing\\Property\\ShareProperty' => __DIR__ . '/../../..' . '/lib/public/Sharing/Property/ShareProperty.php', - 'OCP\\Sharing\\Recipient\\AShareRecipientTypeSearchCollaborator' => __DIR__ . '/../../..' . '/lib/public/Sharing/Recipient/AShareRecipientTypeSearchCollaborator.php', - 'OCP\\Sharing\\Recipient\\IShareRecipientType' => __DIR__ . '/../../..' . '/lib/public/Sharing/Recipient/IShareRecipientType.php', - 'OCP\\Sharing\\Recipient\\IShareRecipientTypePublicSecret' => __DIR__ . '/../../..' . '/lib/public/Sharing/Recipient/IShareRecipientTypePublicSecret.php', - 'OCP\\Sharing\\Recipient\\IShareRecipientTypeSearch' => __DIR__ . '/../../..' . '/lib/public/Sharing/Recipient/IShareRecipientTypeSearch.php', - 'OCP\\Sharing\\Recipient\\ShareRecipient' => __DIR__ . '/../../..' . '/lib/public/Sharing/Recipient/ShareRecipient.php', - 'OCP\\Sharing\\Share' => __DIR__ . '/../../..' . '/lib/public/Sharing/Share.php', - 'OCP\\Sharing\\ShareAccessContext' => __DIR__ . '/../../..' . '/lib/public/Sharing/ShareAccessContext.php', - 'OCP\\Sharing\\ShareState' => __DIR__ . '/../../..' . '/lib/public/Sharing/ShareState.php', - 'OCP\\Sharing\\ShareUser' => __DIR__ . '/../../..' . '/lib/public/Sharing/ShareUser.php', - 'OCP\\Sharing\\Source\\IShareSourceType' => __DIR__ . '/../../..' . '/lib/public/Sharing/Source/IShareSourceType.php', - 'OCP\\Sharing\\Source\\ShareSource' => __DIR__ . '/../../..' . '/lib/public/Sharing/Source/ShareSource.php', 'OCP\\Snowflake\\ISnowflakeDecoder' => __DIR__ . '/../../..' . '/lib/public/Snowflake/ISnowflakeDecoder.php', 'OCP\\Snowflake\\ISnowflakeGenerator' => __DIR__ . '/../../..' . '/lib/public/Snowflake/ISnowflakeGenerator.php', 'OCP\\Snowflake\\Snowflake' => __DIR__ . '/../../..' . '/lib/public/Snowflake/Snowflake.php', diff --git a/lib/private/Server.php b/lib/private/Server.php index a1caf17da3984..5b56ba4cd4b01 100644 --- a/lib/private/Server.php +++ b/lib/private/Server.php @@ -1151,8 +1151,8 @@ function () use ($c) { $this->registerAlias(IJobRuns::class, JobRuns::class); $this->registerAlias(IServerInfo::class, ServerInfo::class); - $this->registerAlias(\OCP\Sharing\ISharingRegistry::class, \OC\Sharing\SharingRegistry::class); - $this->registerAlias(\OCP\Sharing\ISharingManager::class, \OC\Sharing\SharingManager::class); + $this->registerAlias(\NCU\Sharing\ISharingRegistry::class, \OC\Sharing\SharingRegistry::class); + $this->registerAlias(\NCU\Sharing\ISharingManager::class, \OC\Sharing\SharingManager::class); $this->connectDispatcher(); } diff --git a/lib/private/Sharing/SharingManager.php b/lib/private/Sharing/SharingManager.php index f77f3772b3ea3..e4d77626b2075 100644 --- a/lib/private/Sharing/SharingManager.php +++ b/lib/private/Sharing/SharingManager.php @@ -10,6 +10,23 @@ namespace OC\Sharing; use Exception; +use NCU\Sharing\Exception\ShareInvalidException; +use NCU\Sharing\Exception\ShareOperationForbiddenException; +use NCU\Sharing\ISharingBackend; +use NCU\Sharing\ISharingManager; +use NCU\Sharing\ISharingRegistry; +use NCU\Sharing\Permission\ISharePermissionType; +use NCU\Sharing\Permission\SharePermission; +use NCU\Sharing\Property\ShareProperty; +use NCU\Sharing\Recipient\IShareRecipientType; +use NCU\Sharing\Recipient\IShareRecipientTypePublicSecret; +use NCU\Sharing\Recipient\IShareRecipientTypeSearch; +use NCU\Sharing\Recipient\ShareRecipient; +use NCU\Sharing\Share; +use NCU\Sharing\ShareAccessContext; +use NCU\Sharing\ShareState; +use NCU\Sharing\ShareUser; +use NCU\Sharing\Source\ShareSource; use OC\Core\Sharing\Permission\ReshareSharePermissionType; use OCA\Sharing\SharingBackend; use OCP\EventDispatcher\Event; @@ -25,23 +42,6 @@ use OCP\IUserManager; use OCP\L10N\IFactory; use OCP\Security\ISecureRandom; -use OCP\Sharing\Exception\ShareInvalidException; -use OCP\Sharing\Exception\ShareOperationForbiddenException; -use OCP\Sharing\ISharingBackend; -use OCP\Sharing\ISharingManager; -use OCP\Sharing\ISharingRegistry; -use OCP\Sharing\Permission\ISharePermissionType; -use OCP\Sharing\Permission\SharePermission; -use OCP\Sharing\Property\ShareProperty; -use OCP\Sharing\Recipient\IShareRecipientType; -use OCP\Sharing\Recipient\IShareRecipientTypePublicSecret; -use OCP\Sharing\Recipient\IShareRecipientTypeSearch; -use OCP\Sharing\Recipient\ShareRecipient; -use OCP\Sharing\Share; -use OCP\Sharing\ShareAccessContext; -use OCP\Sharing\ShareState; -use OCP\Sharing\ShareUser; -use OCP\Sharing\Source\ShareSource; use OCP\User\Events\BeforeUserDeletedEvent; use Random\Randomizer; use RuntimeException; diff --git a/lib/private/Sharing/SharingRegistry.php b/lib/private/Sharing/SharingRegistry.php index 333beb3b2b2f6..92d415270f884 100644 --- a/lib/private/Sharing/SharingRegistry.php +++ b/lib/private/Sharing/SharingRegistry.php @@ -9,13 +9,13 @@ namespace OC\Sharing; -use OCP\Sharing\ISharingBackend; -use OCP\Sharing\ISharingRegistry; -use OCP\Sharing\Permission\ISharePermissionPreset; -use OCP\Sharing\Permission\ISharePermissionType; -use OCP\Sharing\Property\ISharePropertyType; -use OCP\Sharing\Recipient\IShareRecipientType; -use OCP\Sharing\Source\IShareSourceType; +use NCU\Sharing\ISharingBackend; +use NCU\Sharing\ISharingRegistry; +use NCU\Sharing\Permission\ISharePermissionPreset; +use NCU\Sharing\Permission\ISharePermissionType; +use NCU\Sharing\Property\ISharePropertyType; +use NCU\Sharing\Recipient\IShareRecipientType; +use NCU\Sharing\Source\IShareSourceType; use RuntimeException; // TODO: Maybe add validate method to run all checks before using the manager diff --git a/lib/public/Interaction/Actions/ShareAction.php b/lib/public/Interaction/Actions/ShareAction.php index 3e40dcccfc181..5450a6a2a8cee 100644 --- a/lib/public/Interaction/Actions/ShareAction.php +++ b/lib/public/Interaction/Actions/ShareAction.php @@ -9,10 +9,10 @@ namespace OCP\Interaction\Actions; +use NCU\Sharing\Permission\ISharePermissionType; use OCP\AppFramework\Attribute\Consumable; use OCP\Constants; use OCP\Interaction\InteractionAction; -use OCP\Sharing\Permission\ISharePermissionType; /** * Used when a user wants to share a resource to a receiver. diff --git a/lib/public/Sharing/Exception/AShareException.php b/lib/unstable/Sharing/Exception/AShareException.php similarity index 67% rename from lib/public/Sharing/Exception/AShareException.php rename to lib/unstable/Sharing/Exception/AShareException.php index d86e28c9965c9..64c07e9c9cfd5 100644 --- a/lib/public/Sharing/Exception/AShareException.php +++ b/lib/unstable/Sharing/Exception/AShareException.php @@ -1,19 +1,19 @@ get('sharing')->t('Share not found.')); diff --git a/lib/public/Sharing/Exception/ShareOperationForbiddenException.php b/lib/unstable/Sharing/Exception/ShareOperationForbiddenException.php similarity index 76% rename from lib/public/Sharing/Exception/ShareOperationForbiddenException.php rename to lib/unstable/Sharing/Exception/ShareOperationForbiddenException.php index 6c0d89dbc119e..84d73dcd0c1a6 100644 --- a/lib/public/Sharing/Exception/ShareOperationForbiddenException.php +++ b/lib/unstable/Sharing/Exception/ShareOperationForbiddenException.php @@ -1,25 +1,25 @@ get('sharing')->t('You are not allowed to edit this share.')); diff --git a/lib/public/Sharing/ISharingBackend.php b/lib/unstable/Sharing/ISharingBackend.php similarity index 79% rename from lib/public/Sharing/ISharingBackend.php rename to lib/unstable/Sharing/ISharingBackend.php index 94d501398982d..2ae085b8e6233 100644 --- a/lib/public/Sharing/ISharingBackend.php +++ b/lib/unstable/Sharing/ISharingBackend.php @@ -1,41 +1,41 @@ - * @since 35.0.0 + * @experimental 35.0.0 */ public function onSourceDeleted(ShareSource $source): array; @@ -77,7 +77,7 @@ public function onSourceDeleted(ShareSource $source): array; * * @throws ShareInvalidException * @throws ShareNotFoundException - * @since 35.0.0 + * @experimental 35.0.0 */ public function addShareRecipient(string $id, ShareRecipient $recipient): void; @@ -85,7 +85,7 @@ public function addShareRecipient(string $id, ShareRecipient $recipient): void; * Remove an existing recipient from a share. * * @throws ShareNotFoundException - * @since 35.0.0 + * @experimental 35.0.0 */ public function removeShareRecipient(string $id, ShareRecipient $recipient): void; @@ -93,7 +93,7 @@ public function removeShareRecipient(string $id, ShareRecipient $recipient): voi * Perform all updates when the recipient was deleted. * * @return list - * @since 35.0.0 + * @experimental 35.0.0 */ public function onRecipientDeleted(ShareRecipient $recipient): array; @@ -101,7 +101,7 @@ public function onRecipientDeleted(ShareRecipient $recipient): array; * Perform all updates when the initiator was deleted. * * @return list - * @since 35.0.0 + * @experimental 35.0.0 */ public function onInitiatorDeleted(ShareUser $initiator): array; @@ -109,7 +109,7 @@ public function onInitiatorDeleted(ShareUser $initiator): array; * Update the secret of a recipient. * * @throws ShareNotFoundException - * @since 35.0.0 + * @experimental 35.0.0 */ public function updateShareRecipientSecret(string $id, ShareRecipient $recipient, string $secret): void; @@ -117,7 +117,7 @@ public function updateShareRecipientSecret(string $id, ShareRecipient $recipient * Update a property of a share. * * @throws ShareNotFoundException - * @since 35.0.0 + * @experimental 35.0.0 */ public function updateShareProperty(string $id, ShareProperty $property): void; @@ -125,7 +125,7 @@ public function updateShareProperty(string $id, ShareProperty $property): void; * Update a permission of a share. * * @throws ShareNotFoundException - * @since 35.0.0 + * @experimental 35.0.0 */ public function updateSharePermission(string $id, SharePermission $permission): void; @@ -134,7 +134,7 @@ public function updateSharePermission(string $id, SharePermission $permission): * * @param class-string $permissionPresetClass * @throws ShareNotFoundException - * @since 35.0.0 + * @experimental 35.0.0 */ public function selectSharePermissionPreset(string $id, string $permissionPresetClass): void; @@ -142,7 +142,7 @@ public function selectSharePermissionPreset(string $id, string $permissionPreset * Delete a share. * * @throws ShareNotFoundException - * @since 35.0.0 + * @experimental 35.0.0 */ public function deleteShare(string $id): void; @@ -150,7 +150,7 @@ public function deleteShare(string $id): void; * Get a share. * * @throws ShareNotFoundException - * @since 35.0.0 + * @experimental 35.0.0 */ public function getShare(ShareAccessContext $accessContext, string $id): Share; @@ -160,14 +160,14 @@ public function getShare(ShareAccessContext $accessContext, string $id): Share; * @param ?class-string $filterSourceTypeClass * @param ?positive-int $limit * @return list - * @since 35.0.0 + * @experimental 35.0.0 */ public function getShares(ShareAccessContext $accessContext, ?string $filterSourceTypeClass, ?string $filterSourceTypeValue, ?string $lastShareID, ?int $limit): array; /** * Check if a share ID belongs to this backend. * - * @since 35.0.0 + * @experimental 35.0.0 */ public function hasShare(string $id): bool; @@ -175,7 +175,7 @@ public function hasShare(string $id): bool; * Get the owner of a share. * * @throws ShareNotFoundException - * @since 35.0.0 + * @experimental 35.0.0 */ public function getShareOwner(string $id): ShareUser; @@ -185,7 +185,7 @@ public function getShareOwner(string $id): ShareUser; * @param non-empty-list $ids * @param non-negative-int $lastUpdated * @throws ShareNotFoundException - * @since 35.0.0 + * @experimental 35.0.0 */ public function setLastUpdated(array $ids, int $lastUpdated): void; } diff --git a/lib/public/Sharing/ISharingManager.php b/lib/unstable/Sharing/ISharingManager.php similarity index 82% rename from lib/public/Sharing/ISharingManager.php rename to lib/unstable/Sharing/ISharingManager.php index 6b017d7304806..ebbe7b6059c4f 100644 --- a/lib/public/Sharing/ISharingManager.php +++ b/lib/unstable/Sharing/ISharingManager.php @@ -1,28 +1,28 @@ * @throws ShareNotFoundException - * @since 35.0.0 + * @experimental 35.0.0 */ public function searchRecipients(ShareAccessContext $accessContext, ?array $filterRecipientTypeClasses, string $query, int $limit, int $offset, ?string $id = null): array; @@ -43,7 +43,7 @@ public function searchRecipients(ShareAccessContext $accessContext, ?array $filt * Generate a new secret. * * @return non-empty-string - * @since 35.0.0 + * @experimental 35.0.0 */ public function generateSecret(): string; @@ -51,21 +51,21 @@ public function generateSecret(): string; * Generate a new timestamp in milliseconds since the UNIX epoch. * * @return non-negative-int - * @since 35.0.0 + * @experimental 35.0.0 */ public function generateTimestamp(): int; /** * Create a new share. * - * @since 35.0.0 + * @experimental 35.0.0 */ public function createShare(ShareAccessContext $accessContext): string; /** * Perform all updates when the owner was deleted. * - * @since 35.0.0 + * @experimental 35.0.0 */ public function onOwnerDeleted(ShareAccessContext $accessContext, ShareUser $owner): void; @@ -75,7 +75,7 @@ public function onOwnerDeleted(ShareAccessContext $accessContext, ShareUser $own * @throws ShareInvalidException * @throws ShareNotFoundException * @throws ShareOperationForbiddenException - * @since 35.0.0 + * @experimental 35.0.0 */ public function updateShareState(ShareAccessContext $accessContext, string $id, ShareState $state): void; @@ -85,7 +85,7 @@ public function updateShareState(ShareAccessContext $accessContext, string $id, * @throws ShareInvalidException * @throws ShareNotFoundException * @throws ShareOperationForbiddenException - * @since 35.0.0 + * @experimental 35.0.0 */ public function addShareSource(ShareAccessContext $accessContext, string $id, ShareSource $source): void; @@ -94,14 +94,14 @@ public function addShareSource(ShareAccessContext $accessContext, string $id, Sh * * @throws ShareNotFoundException * @throws ShareOperationForbiddenException - * @since 35.0.0 + * @experimental 35.0.0 */ public function removeShareSource(ShareAccessContext $accessContext, string $id, ShareSource $source): void; /** * Perform all updates when the source was deleted. * - * @since 35.0.0 + * @experimental 35.0.0 */ public function onSourceDeleted(ShareAccessContext $accessContext, ShareSource $source): void; @@ -111,7 +111,7 @@ public function onSourceDeleted(ShareAccessContext $accessContext, ShareSource $ * @throws ShareInvalidException * @throws ShareNotFoundException * @throws ShareOperationForbiddenException - * @since 35.0.0 + * @experimental 35.0.0 */ public function addShareRecipient(ShareAccessContext $accessContext, string $id, ShareRecipient $recipient): void; @@ -120,21 +120,21 @@ public function addShareRecipient(ShareAccessContext $accessContext, string $id, * * @throws ShareNotFoundException * @throws ShareOperationForbiddenException - * @since 35.0.0 + * @experimental 35.0.0 */ public function removeShareRecipient(ShareAccessContext $accessContext, string $id, ShareRecipient $recipient): void; /** * Perform all updates when the recipient was deleted. * - * @since 35.0.0 + * @experimental 35.0.0 */ public function onRecipientDeleted(ShareAccessContext $accessContext, ShareRecipient $recipient): void; /** * Perform all updates when the initiator was deleted. * - * @since 35.0.0 + * @experimental 35.0.0 */ public function onInitiatorDeleted(ShareAccessContext $accessContext, ShareUser $initiator): void; @@ -144,7 +144,7 @@ public function onInitiatorDeleted(ShareAccessContext $accessContext, ShareUser * @throws ShareInvalidException * @throws ShareNotFoundException * @throws ShareOperationForbiddenException - * @since 35.0.0 + * @experimental 35.0.0 */ public function updateShareRecipientSecret(ShareAccessContext $accessContext, string $id, ShareRecipient $recipient, string $secret): void; @@ -154,7 +154,7 @@ public function updateShareRecipientSecret(ShareAccessContext $accessContext, st * @throws ShareInvalidException * @throws ShareNotFoundException * @throws ShareOperationForbiddenException - * @since 35.0.0 + * @experimental 35.0.0 */ public function updateShareProperty(ShareAccessContext $accessContext, string $id, ShareProperty $property): void; @@ -164,7 +164,7 @@ public function updateShareProperty(ShareAccessContext $accessContext, string $i * @throws ShareInvalidException * @throws ShareNotFoundException * @throws ShareOperationForbiddenException - * @since 35.0.0 + * @experimental 35.0.0 */ public function updateSharePermission(ShareAccessContext $accessContext, string $id, SharePermission $permission): void; @@ -174,7 +174,7 @@ public function updateSharePermission(ShareAccessContext $accessContext, string * @param class-string $permissionPresetClass * @throws ShareNotFoundException * @throws ShareOperationForbiddenException - * @since 35.0.0 + * @experimental 35.0.0 */ public function selectSharePermissionPreset(ShareAccessContext $accessContext, string $id, string $permissionPresetClass): void; @@ -183,7 +183,7 @@ public function selectSharePermissionPreset(ShareAccessContext $accessContext, s * * @throws ShareNotFoundException * @throws ShareOperationForbiddenException - * @since 35.0.0 + * @experimental 35.0.0 */ public function deleteShare(ShareAccessContext $accessContext, string $id): void; @@ -191,7 +191,7 @@ public function deleteShare(ShareAccessContext $accessContext, string $id): void * Get a share. * * @throws ShareNotFoundException - * @since 35.0.0 + * @experimental 35.0.0 */ public function getShare(ShareAccessContext $accessContext, string $id): Share; @@ -202,7 +202,7 @@ public function getShare(ShareAccessContext $accessContext, string $id): Share; * @param ?class-string $filterSourceTypeClass * @param ?positive-int $limit * @return list - * @since 35.0.0 + * @experimental 35.0.0 */ public function getShares(ShareAccessContext $accessContext, ?string $filterSourceTypeClass, ?string $filterSourceTypeValue, ?string $lastShareID, ?int $limit): array; } diff --git a/lib/public/Sharing/ISharingRegistry.php b/lib/unstable/Sharing/ISharingRegistry.php similarity index 79% rename from lib/public/Sharing/ISharingRegistry.php rename to lib/unstable/Sharing/ISharingRegistry.php index e145df06c5feb..81fda046e17e2 100644 --- a/lib/public/Sharing/ISharingRegistry.php +++ b/lib/unstable/Sharing/ISharingRegistry.php @@ -1,158 +1,158 @@ , ISharingBackend> - * @since 35.0.0 + * @experimental 35.0.0 */ public function getSharingBackends(): array; /** - * @since 35.0.0 + * @experimental 35.0.0 */ public function registerSourceType(IShareSourceType $sourceType): void; /** * @return array, IShareSourceType> - * @since 35.0.0 + * @experimental 35.0.0 */ public function getSourceTypes(): array; /** * @return array, list>> - * @since 35.0.0 + * @experimental 35.0.0 */ public function getPropertyTypeCompatibleSourceTypeClasses(): array; /** - * @since 35.0.0 + * @experimental 35.0.0 */ public function registerRecipientType(IShareRecipientType $recipientType): void; /** * @return array, IShareRecipientType> - * @since 35.0.0 + * @experimental 35.0.0 */ public function getRecipientTypes(): array; /** * @return array, list>> - * @since 35.0.0 + * @experimental 35.0.0 */ public function getPropertyTypeCompatibleRecipientTypes(): array; /** - * @since 35.0.0 + * @experimental 35.0.0 */ public function registerPropertyType(ISharePropertyType $propertyType): void; /** * @param class-string $propertyTypeClass * @param class-string $sourceTypeClass - * @since 35.0.0 + * @experimental 35.0.0 */ public function markPropertyTypeCompatibleWithSourceType(string $propertyTypeClass, string $sourceTypeClass): void; /** * @param class-string $propertyTypeClass * @param class-string $recipientTypeClass - * @since 35.0.0 + * @experimental 35.0.0 */ public function markPropertyTypeCompatibleWithRecipientType(string $propertyTypeClass, string $recipientTypeClass): void; /** * @return array, ISharePropertyType> - * @since 35.0.0 + * @experimental 35.0.0 */ public function getPropertyTypes(): array; /** * @param class-string $sourceTypeClass - * @since 35.0.0 + * @experimental 35.0.0 */ public function registerPermissionType(?string $sourceTypeClass, ISharePermissionType $permissionType): void; /** * @return array, ISharePermissionType> - * @since 35.0.0 + * @experimental 35.0.0 */ public function getPermissionTypes(): array; /** * @return array, ?class-string> - * @since 35.0.0 + * @experimental 35.0.0 */ public function getPermissionTypeSourceTypeClass(): array; /** * @return array, list>> - * @since 35.0.0 + * @experimental 35.0.0 */ public function getSourceTypePermissionTypeClasses(): array; /** * @return list> - * @since 35.0.0 + * @experimental 35.0.0 */ public function getGenericPermissionTypeClasses(): array; /** - * @since 35.0.0 + * @experimental 35.0.0 */ public function registerPermissionPreset(ISharePermissionPreset $permissionPreset): void; /** * @return array, ISharePermissionPreset> - * @since 35.0.0 + * @experimental 35.0.0 */ public function getPermissionPresets(): array; /** * @param class-string $permissionTypeClass * @param class-string $permissionPresetClass - * @since 35.0.0 + * @experimental 35.0.0 */ public function markPermissionTypeCompatibleWithPermissionPreset(string $permissionTypeClass, string $permissionPresetClass): void; /** * @return array, list>> - * @since 35.0.0 + * @experimental 35.0.0 */ public function getPermissionTypeCompatiblePermissionPresetClasses(): array; /** * @return array, non-empty-list>> - * @since 35.0.0 + * @experimental 35.0.0 */ public function getPermissionPresetCompatiblePermissionTypeClasses(): array; } diff --git a/lib/public/Sharing/Icon/ShareIconSVG.php b/lib/unstable/Sharing/Icon/ShareIconSVG.php similarity index 84% rename from lib/public/Sharing/Icon/ShareIconSVG.php rename to lib/unstable/Sharing/Icon/ShareIconSVG.php index 953f689ce7ce8..2ccfca6d8a8f0 100644 --- a/lib/public/Sharing/Icon/ShareIconSVG.php +++ b/lib/unstable/Sharing/Icon/ShareIconSVG.php @@ -7,20 +7,20 @@ declare(strict_types=1); -namespace OCP\Sharing\Icon; +namespace NCU\Sharing\Icon; +use NCU\Sharing\Share; use OCP\AppFramework\Attribute\Consumable; -use OCP\Sharing\Share; use RuntimeException; /** * @psalm-import-type SharingIconSVG from Share - * @since 35.0.0 + * @experimental 35.0.0 */ #[Consumable(since: '35.0.0')] final readonly class ShareIconSVG { /** - * @since 35.0.0 + * @experimental 35.0.0 */ public function __construct( /** @var non-empty-string $svg */ @@ -33,7 +33,7 @@ public function __construct( /** * @return SharingIconSVG - * @since 35.0.0 + * @experimental 35.0.0 */ public function format(): array { return [ diff --git a/lib/public/Sharing/Icon/ShareIconURL.php b/lib/unstable/Sharing/Icon/ShareIconURL.php similarity index 88% rename from lib/public/Sharing/Icon/ShareIconURL.php rename to lib/unstable/Sharing/Icon/ShareIconURL.php index 51d235d9c5d0e..4dff9988916a1 100644 --- a/lib/public/Sharing/Icon/ShareIconURL.php +++ b/lib/unstable/Sharing/Icon/ShareIconURL.php @@ -7,20 +7,20 @@ declare(strict_types=1); -namespace OCP\Sharing\Icon; +namespace NCU\Sharing\Icon; +use NCU\Sharing\Share; use OCP\AppFramework\Attribute\Consumable; -use OCP\Sharing\Share; use RuntimeException; /** * @psalm-import-type SharingIconURL from Share - * @since 35.0.0 + * @experimental 35.0.0 */ #[Consumable(since: '35.0.0')] final readonly class ShareIconURL { /** - * @since 35.0.0 + * @experimental 35.0.0 */ public function __construct( /** @var non-empty-string $light */ @@ -39,7 +39,7 @@ public function __construct( /** * @return SharingIconURL - * @since 35.0.0 + * @experimental 35.0.0 */ public function format(): array { return [ diff --git a/lib/public/Sharing/Permission/ISharePermissionPreset.php b/lib/unstable/Sharing/Permission/ISharePermissionPreset.php similarity index 73% rename from lib/public/Sharing/Permission/ISharePermissionPreset.php rename to lib/unstable/Sharing/Permission/ISharePermissionPreset.php index 54ff4e63f99e6..504ff09ea4a9d 100644 --- a/lib/public/Sharing/Permission/ISharePermissionPreset.php +++ b/lib/unstable/Sharing/Permission/ISharePermissionPreset.php @@ -1,5 +1,10 @@ - * @since 35.0.0 + * @experimental 35.0.0 */ public function getPriority(): int; /** * Whether this permission is enabled by default or not. * - * @since 35.0.0 + * @experimental 35.0.0 */ public function isEnabledByDefault(): bool; } diff --git a/lib/public/Sharing/Permission/SharePermission.php b/lib/unstable/Sharing/Permission/SharePermission.php similarity index 88% rename from lib/public/Sharing/Permission/SharePermission.php rename to lib/unstable/Sharing/Permission/SharePermission.php index a14993e590a46..5d392a3126e62 100644 --- a/lib/public/Sharing/Permission/SharePermission.php +++ b/lib/unstable/Sharing/Permission/SharePermission.php @@ -7,22 +7,22 @@ declare(strict_types=1); -namespace OCP\Sharing\Permission; +namespace NCU\Sharing\Permission; +use NCU\Sharing\ISharingRegistry; +use NCU\Sharing\Share; use OCP\AppFramework\Attribute\Consumable; use OCP\L10N\IFactory; -use OCP\Sharing\ISharingRegistry; -use OCP\Sharing\Share; use RuntimeException; /** * @psalm-import-type SharingPermission from Share - * @since 35.0.0 + * @experimental 35.0.0 */ #[Consumable(since: '35.0.0')] final readonly class SharePermission { /** - * @since 35.0.0 + * @experimental 35.0.0 */ public function __construct( /** @var class-string $class */ @@ -33,7 +33,7 @@ public function __construct( /** * @return SharingPermission - * @since 35.0.0 + * @experimental 35.0.0 */ public function format(ISharingRegistry $registry, IFactory $l10nFactory): array { if (($permissionType = ($registry->getPermissionTypes()[$this->class] ?? null)) === null) { diff --git a/lib/public/Sharing/Property/ABooleanSharePropertyType.php b/lib/unstable/Sharing/Property/ABooleanSharePropertyType.php similarity index 88% rename from lib/public/Sharing/Property/ABooleanSharePropertyType.php rename to lib/unstable/Sharing/Property/ABooleanSharePropertyType.php index 2b5ec9b851b4e..7d90dd2de13da 100644 --- a/lib/public/Sharing/Property/ABooleanSharePropertyType.php +++ b/lib/unstable/Sharing/Property/ABooleanSharePropertyType.php @@ -7,22 +7,22 @@ declare(strict_types=1); -namespace OCP\Sharing\Property; +namespace NCU\Sharing\Property; +use NCU\Sharing\Share; use OC\Core\AppInfo\Application; use OCP\AppFramework\Attribute\Implementable; use OCP\L10N\IFactory; -use OCP\Sharing\Share; /** * @psalm-import-type SharingProperty from Share * @psalm-import-type SharingPropertyBoolean from Share - * @since 35.0.0 + * @experimental 35.0.0 */ #[Implementable(since: '35.0.0')] abstract class ABooleanSharePropertyType implements ISharePropertyType { /** - * @since 35.0.0 + * @experimental 35.0.0 */ #[\Override] public function validateValue(IFactory $l10nFactory, Share $share, string $value): true|string { @@ -36,7 +36,7 @@ public function validateValue(IFactory $l10nFactory, Share $share, string $value /** * @param SharingProperty $property * @return SharingPropertyBoolean - * @since 35.0.0 + * @experimental 35.0.0 */ #[\Override] public function format(Share $share, array $property): array { diff --git a/lib/public/Sharing/Property/ADateSharePropertyType.php b/lib/unstable/Sharing/Property/ADateSharePropertyType.php similarity index 91% rename from lib/public/Sharing/Property/ADateSharePropertyType.php rename to lib/unstable/Sharing/Property/ADateSharePropertyType.php index 510e08981e2e2..714b25a1d6e5b 100644 --- a/lib/public/Sharing/Property/ADateSharePropertyType.php +++ b/lib/unstable/Sharing/Property/ADateSharePropertyType.php @@ -7,35 +7,35 @@ declare(strict_types=1); -namespace OCP\Sharing\Property; +namespace NCU\Sharing\Property; use DateTimeImmutable; use DateTimeInterface; use Exception; +use NCU\Sharing\Share; use OC\Core\AppInfo\Application; use OCP\AppFramework\Attribute\Implementable; use OCP\L10N\IFactory; -use OCP\Sharing\Share; /** * @psalm-import-type SharingProperty from Share * @psalm-import-type SharingPropertyDate from Share - * @since 35.0.0 + * @experimental 35.0.0 */ #[Implementable(since: '35.0.0')] abstract class ADateSharePropertyType implements ISharePropertyType { /** - * @since 35.0.0 + * @experimental 35.0.0 */ abstract public function getMinDate(Share $share): ?DateTimeImmutable; /** - * @since 35.0.0 + * @experimental 35.0.0 */ abstract public function getMaxDate(Share $share): ?DateTimeImmutable; /** - * @since 35.0.0 + * @experimental 35.0.0 */ #[\Override] public function validateValue(IFactory $l10nFactory, Share $share, string $value): true|string { @@ -65,7 +65,7 @@ public function validateValue(IFactory $l10nFactory, Share $share, string $value /** * @param SharingProperty $property * @return SharingPropertyDate - * @since 35.0.0 + * @experimental 35.0.0 */ #[\Override] public function format(Share $share, array $property): array { diff --git a/lib/public/Sharing/Property/AEnumSharePropertyType.php b/lib/unstable/Sharing/Property/AEnumSharePropertyType.php similarity index 88% rename from lib/public/Sharing/Property/AEnumSharePropertyType.php rename to lib/unstable/Sharing/Property/AEnumSharePropertyType.php index 9ce85deb5f831..d9d6dba3eb04a 100644 --- a/lib/public/Sharing/Property/AEnumSharePropertyType.php +++ b/lib/unstable/Sharing/Property/AEnumSharePropertyType.php @@ -7,28 +7,28 @@ declare(strict_types=1); -namespace OCP\Sharing\Property; +namespace NCU\Sharing\Property; +use NCU\Sharing\Share; use OC\Core\AppInfo\Application; use OCP\AppFramework\Attribute\Implementable; use OCP\L10N\IFactory; -use OCP\Sharing\Share; /** * @psalm-import-type SharingProperty from Share * @psalm-import-type SharingPropertyEnum from Share - * @since 35.0.0 + * @experimental 35.0.0 */ #[Implementable(since: '35.0.0')] abstract class AEnumSharePropertyType implements ISharePropertyType { /** * @return non-empty-list - * @since 35.0.0 + * @experimental 35.0.0 */ abstract public function getValidValues(): array; /** - * @since 35.0.0 + * @experimental 35.0.0 */ #[\Override] public function validateValue(IFactory $l10nFactory, Share $share, string $value): true|string { @@ -43,7 +43,7 @@ public function validateValue(IFactory $l10nFactory, Share $share, string $value /** * @param SharingProperty $property * @return SharingPropertyEnum - * @since 35.0.0 + * @experimental 35.0.0 */ #[\Override] public function format(Share $share, array $property): array { diff --git a/lib/public/Sharing/Property/APasswordSharePropertyType.php b/lib/unstable/Sharing/Property/APasswordSharePropertyType.php similarity index 91% rename from lib/public/Sharing/Property/APasswordSharePropertyType.php rename to lib/unstable/Sharing/Property/APasswordSharePropertyType.php index 1573a33d2c17f..4ff5ba8a62eb3 100644 --- a/lib/public/Sharing/Property/APasswordSharePropertyType.php +++ b/lib/unstable/Sharing/Property/APasswordSharePropertyType.php @@ -7,8 +7,9 @@ declare(strict_types=1); -namespace OCP\Sharing\Property; +namespace NCU\Sharing\Property; +use NCU\Sharing\Share; use OCP\AppFramework\Attribute\Implementable; use OCP\EventDispatcher\IEventDispatcher; use OCP\HintException; @@ -17,17 +18,16 @@ use OCP\Security\IHasher; use OCP\Security\PasswordContext; use OCP\Server; -use OCP\Sharing\Share; /** * @psalm-import-type SharingProperty from Share * @psalm-import-type SharingPropertyPassword from Share - * @since 35.0.0 + * @experimental 35.0.0 */ #[Implementable(since: '35.0.0')] abstract class APasswordSharePropertyType implements ISharePropertyType, ISharePropertyTypeModifyValue { /** - * @since 35.0.0 + * @experimental 35.0.0 */ public const string PLACEHOLDER = 'PROVOKJNLDSV'; @@ -44,7 +44,7 @@ private function getHasher(): IHasher { } /** - * @since 35.0.0 + * @experimental 35.0.0 */ #[\Override] public function validateValue(IFactory $l10nFactory, Share $share, string $value): true|string { @@ -61,7 +61,7 @@ public function validateValue(IFactory $l10nFactory, Share $share, string $value } /** - * @since 35.0.0 + * @experimental 35.0.0 */ #[\Override] public function modifyValueOnSave(?string $oldValue, ?string $newValue): ?string { @@ -77,7 +77,7 @@ public function modifyValueOnSave(?string $oldValue, ?string $newValue): ?string } /** - * @since 35.0.0 + * @experimental 35.0.0 */ #[\Override] public function modifyValueOnLoad(?string $value): ?string { @@ -91,7 +91,7 @@ public function modifyValueOnLoad(?string $value): ?string { /** * @param SharingProperty $property * @return SharingPropertyPassword - * @since 35.0.0 + * @experimental 35.0.0 */ #[\Override] public function format(Share $share, array $property): array { diff --git a/lib/public/Sharing/Property/AStringSharePropertyType.php b/lib/unstable/Sharing/Property/AStringSharePropertyType.php similarity index 89% rename from lib/public/Sharing/Property/AStringSharePropertyType.php rename to lib/unstable/Sharing/Property/AStringSharePropertyType.php index d1577dd6c32f4..3cefcc81d951d 100644 --- a/lib/public/Sharing/Property/AStringSharePropertyType.php +++ b/lib/unstable/Sharing/Property/AStringSharePropertyType.php @@ -7,34 +7,34 @@ declare(strict_types=1); -namespace OCP\Sharing\Property; +namespace NCU\Sharing\Property; +use NCU\Sharing\Share; use OC\Core\AppInfo\Application; use OCP\AppFramework\Attribute\Implementable; use OCP\L10N\IFactory; -use OCP\Sharing\Share; /** * @psalm-import-type SharingProperty from Share * @psalm-import-type SharingPropertyString from Share - * @since 35.0.0 + * @experimental 35.0.0 */ #[Implementable(since: '35.0.0')] abstract class AStringSharePropertyType implements ISharePropertyType { /** * @return ?positive-int - * @since 35.0.0 + * @experimental 35.0.0 */ abstract public function getMinLength(): ?int; /** * @return ?positive-int - * @since 35.0.0 + * @experimental 35.0.0 */ abstract public function getMaxLength(): ?int; /** - * @since 35.0.0 + * @experimental 35.0.0 */ #[\Override] public function validateValue(IFactory $l10nFactory, Share $share, string $value): true|string { @@ -52,7 +52,7 @@ public function validateValue(IFactory $l10nFactory, Share $share, string $value /** * @param SharingProperty $property * @return SharingPropertyString - * @since 35.0.0 + * @experimental 35.0.0 */ #[\Override] public function format(Share $share, array $property): array { diff --git a/lib/public/Sharing/Property/ISharePropertyType.php b/lib/unstable/Sharing/Property/ISharePropertyType.php similarity index 90% rename from lib/public/Sharing/Property/ISharePropertyType.php rename to lib/unstable/Sharing/Property/ISharePropertyType.php index 1eb05c8bec3cd..118e3da0b63ad 100644 --- a/lib/public/Sharing/Property/ISharePropertyType.php +++ b/lib/unstable/Sharing/Property/ISharePropertyType.php @@ -12,11 +12,11 @@ * SPDX-License-Identifier: AGPL-3.0-or-later */ -namespace OCP\Sharing\Property; +namespace NCU\Sharing\Property; +use NCU\Sharing\Share; use OCP\AppFramework\Attribute\Implementable; use OCP\L10N\IFactory; -use OCP\Sharing\Share; /** * @psalm-import-type SharingProperty from Share @@ -25,7 +25,7 @@ * @psalm-import-type SharingPropertyEnum from Share * @psalm-import-type SharingPropertyPassword from Share * @psalm-import-type SharingPropertyString from Share - * @since 35.0.0 + * @experimental 35.0.0 */ #[Implementable(since: '35.0.0')] interface ISharePropertyType { @@ -33,7 +33,7 @@ interface ISharePropertyType { * Returns a user friendly display name for this property. * * @return non-empty-string - * @since 35.0.0 + * @experimental 35.0.0 */ public function getDisplayName(IFactory $l10nFactory): string; @@ -41,7 +41,7 @@ public function getDisplayName(IFactory $l10nFactory): string; * Returns a user friendly hint for this property. * * @return ?non-empty-string - * @since 35.0.0 + * @experimental 35.0.0 */ public function getHint(IFactory $l10nFactory, Share $share): ?string; @@ -50,21 +50,21 @@ public function getHint(IFactory $l10nFactory, Share $share): ?string; * A higher value means the property will be shown further up in the list of properties. * * @return int<1, 100> - * @since 35.0.0 + * @experimental 35.0.0 */ public function getPriority(): int; /** * Whether clients should show it in the advanced settings section. * - * @since 35.0.0 + * @experimental 35.0.0 */ public function isAdvanced(): bool; /** * Whether this property is required to be set. * - * @since 35.0.0 + * @experimental 35.0.0 */ public function isRequired(Share $share): bool; @@ -75,7 +75,7 @@ public function isRequired(Share $share): bool; * * If the class also implements {@see ISharePropertyTypeModifyValue}, {@see ISharePropertyTypeModifyValue::modifyValueOnSave()} will be called when the value is saved to the database, but the value will be returned to the user as-is. * - * @since 35.0.0 + * @experimental 35.0.0 */ public function getDefaultValue(Share $share): ?string; @@ -84,14 +84,14 @@ public function getDefaultValue(Share $share): ?string; * * Returns a user friendly error message if the value is not valid. * - * @since 35.0.0 + * @experimental 35.0.0 */ public function validateValue(IFactory $l10nFactory, Share $share, string $value): true|string; /** * @param SharingProperty $property * @return SharingPropertyBoolean|SharingPropertyDate|SharingPropertyEnum|SharingPropertyPassword|SharingPropertyString - * @since 35.0.0 + * @experimental 35.0.0 */ public function format(Share $share, array $property): array; } diff --git a/lib/public/Sharing/Property/ISharePropertyTypeFilter.php b/lib/unstable/Sharing/Property/ISharePropertyTypeFilter.php similarity index 80% rename from lib/public/Sharing/Property/ISharePropertyTypeFilter.php rename to lib/unstable/Sharing/Property/ISharePropertyTypeFilter.php index cd8562698b534..a972bd8b1f258 100644 --- a/lib/public/Sharing/Property/ISharePropertyTypeFilter.php +++ b/lib/unstable/Sharing/Property/ISharePropertyTypeFilter.php @@ -7,14 +7,14 @@ declare(strict_types=1); -namespace OCP\Sharing\Property; +namespace NCU\Sharing\Property; +use NCU\Sharing\Share; +use NCU\Sharing\ShareAccessContext; use OCP\AppFramework\Attribute\Implementable; -use OCP\Sharing\Share; -use OCP\Sharing\ShareAccessContext; /** - * @since 35.0.0 + * @experimental 35.0.0 */ #[Implementable(since: '35.0.0')] interface ISharePropertyTypeFilter extends ISharePropertyType { @@ -23,7 +23,7 @@ interface ISharePropertyTypeFilter extends ISharePropertyType { * * The method is called for every share, regardless if the property itself is present or not. * - * @since 35.0.0 + * @experimental 35.0.0 */ public function isFiltered(ShareAccessContext $accessContext, Share $share): bool; } diff --git a/lib/public/Sharing/Property/ISharePropertyTypeModifyValue.php b/lib/unstable/Sharing/Property/ISharePropertyTypeModifyValue.php similarity index 87% rename from lib/public/Sharing/Property/ISharePropertyTypeModifyValue.php rename to lib/unstable/Sharing/Property/ISharePropertyTypeModifyValue.php index dbbfb6bf61aa1..268d018036ee4 100644 --- a/lib/public/Sharing/Property/ISharePropertyTypeModifyValue.php +++ b/lib/unstable/Sharing/Property/ISharePropertyTypeModifyValue.php @@ -7,12 +7,12 @@ declare(strict_types=1); -namespace OCP\Sharing\Property; +namespace NCU\Sharing\Property; use OCP\AppFramework\Attribute\Implementable; /** - * @since 35.0.0 + * @experimental 35.0.0 */ #[Implementable(since: '35.0.0')] interface ISharePropertyTypeModifyValue extends ISharePropertyType { @@ -21,14 +21,14 @@ interface ISharePropertyTypeModifyValue extends ISharePropertyType { * * The value has been passed to {@see self::validateValue()} before the invocation of this method. * - * @since 35.0.0 + * @experimental 35.0.0 */ public function modifyValueOnSave(?string $oldValue, ?string $newValue): ?string; /** * Modify the value whenever a share is fetched from the database. * - * @since 35.0.0 + * @experimental 35.0.0 */ public function modifyValueOnLoad(?string $value): ?string; } diff --git a/lib/public/Sharing/Property/ShareProperty.php b/lib/unstable/Sharing/Property/ShareProperty.php similarity index 90% rename from lib/public/Sharing/Property/ShareProperty.php rename to lib/unstable/Sharing/Property/ShareProperty.php index 37eed802b82d8..ae1bc23b71afb 100644 --- a/lib/public/Sharing/Property/ShareProperty.php +++ b/lib/unstable/Sharing/Property/ShareProperty.php @@ -7,12 +7,12 @@ declare(strict_types=1); -namespace OCP\Sharing\Property; +namespace NCU\Sharing\Property; +use NCU\Sharing\ISharingRegistry; +use NCU\Sharing\Share; use OCP\AppFramework\Attribute\Consumable; use OCP\L10N\IFactory; -use OCP\Sharing\ISharingRegistry; -use OCP\Sharing\Share; use RuntimeException; /** @@ -21,12 +21,12 @@ * @psalm-import-type SharingPropertyBoolean from Share * @psalm-import-type SharingPropertyPassword from Share * @psalm-import-type SharingPropertyString from Share - * @since 35.0.0 + * @experimental 35.0.0 */ #[Consumable(since: '35.0.0')] final readonly class ShareProperty { /** - * @since 35.0.0 + * @experimental 35.0.0 */ public function __construct( /** @var class-string $class */ @@ -37,7 +37,7 @@ public function __construct( /** * @return SharingPropertyBoolean|SharingPropertyDate|SharingPropertyEnum|SharingPropertyPassword|SharingPropertyString - * @since 35.0.0 + * @experimental 35.0.0 */ public function format(ISharingRegistry $registry, IFactory $l10nFactory, Share $share): array { if (($propertyType = ($registry->getPropertyTypes()[$this->class] ?? null)) === null) { diff --git a/lib/public/Sharing/Recipient/AShareRecipientTypeSearchCollaborator.php b/lib/unstable/Sharing/Recipient/AShareRecipientTypeSearchCollaborator.php similarity index 95% rename from lib/public/Sharing/Recipient/AShareRecipientTypeSearchCollaborator.php rename to lib/unstable/Sharing/Recipient/AShareRecipientTypeSearchCollaborator.php index f4587d5baccff..beb1b271dc720 100644 --- a/lib/public/Sharing/Recipient/AShareRecipientTypeSearchCollaborator.php +++ b/lib/unstable/Sharing/Recipient/AShareRecipientTypeSearchCollaborator.php @@ -7,19 +7,19 @@ declare(strict_types=1); -namespace OCP\Sharing\Recipient; +namespace NCU\Sharing\Recipient; +use NCU\Sharing\ShareAccessContext; use OCP\AppFramework\Attribute\Implementable; use OCP\Collaboration\Collaborators\ISearch; use OCP\IUser; use OCP\IUserSession; use OCP\Server; use OCP\Share\IShare; -use OCP\Sharing\ShareAccessContext; use RuntimeException; /** - * @since 34.0.0 + * @experimental 34.0.0 */ #[Implementable(since: '34.0.0')] abstract class AShareRecipientTypeSearchCollaborator implements IShareRecipientTypeSearch { @@ -37,12 +37,12 @@ private function getSearch(): ISearch { /** * @return IShare::TYPE_* - * @since 35.0.0 + * @experimental 35.0.0 */ abstract public function getCollaboratorType(): int; /** - * @since 35.0.0 + * @experimental 35.0.0 */ abstract public function getCollaboratorKey(): string; @@ -52,7 +52,7 @@ abstract public function getCollaboratorKey(): string; * @param positive-int $limit * @param non-negative-int $offset * @return list - * @since 35.0.0 + * @experimental 35.0.0 */ #[\Override] public function searchRecipients(ShareAccessContext $accessContext, string $query, int $limit, int $offset): array { diff --git a/lib/public/Sharing/Recipient/IShareRecipientType.php b/lib/unstable/Sharing/Recipient/IShareRecipientType.php similarity index 83% rename from lib/public/Sharing/Recipient/IShareRecipientType.php rename to lib/unstable/Sharing/Recipient/IShareRecipientType.php index 6d3627f98d7d9..1513da606a293 100644 --- a/lib/public/Sharing/Recipient/IShareRecipientType.php +++ b/lib/unstable/Sharing/Recipient/IShareRecipientType.php @@ -7,17 +7,17 @@ declare(strict_types=1); -namespace OCP\Sharing\Recipient; +namespace NCU\Sharing\Recipient; +use NCU\Sharing\Icon\ShareIconSVG; +use NCU\Sharing\Icon\ShareIconURL; use OCP\AppFramework\Attribute\Implementable; use OCP\Interaction\InteractionReceiver; use OCP\IUser; use OCP\L10N\IFactory; -use OCP\Sharing\Icon\ShareIconSVG; -use OCP\Sharing\Icon\ShareIconURL; /** - * @since 35.0.0 + * @experimental 35.0.0 */ #[Implementable(since: '35.0.0')] interface IShareRecipientType { @@ -25,7 +25,7 @@ interface IShareRecipientType { * Returns a user friendly display name for this recipient type. * * @return non-empty-string - * @since 35.0.0 + * @experimental 35.0.0 */ public function getDisplayName(IFactory $l10nFactory): string; @@ -35,7 +35,7 @@ public function getDisplayName(IFactory $l10nFactory): string; * Any check if the recipient is allowed to be shared to, must be implemented through {@see RestrictInteractionEvent}. * * @param non-empty-string $recipient - * @since 35.0.0 + * @experimental 35.0.0 */ public function validateRecipient(string $recipient): bool; @@ -43,26 +43,26 @@ public function validateRecipient(string $recipient): bool; * Get possible recipient values for the current user. * * @return list - * @since 35.0.0 + * @experimental 35.0.0 */ public function getRecipients(?IUser $currentUser, mixed $arguments): array; /** * @param non-empty-string $recipient * @return ?non-empty-string - * @since 35.0.0 + * @experimental 35.0.0 */ public function getRecipientDisplayName(string $recipient): ?string; /** * @param non-empty-string $recipient - * @since 35.0.0 + * @experimental 35.0.0 */ public function getRecipientIcon(string $recipient): null|ShareIconSVG|ShareIconURL; /** * @param non-empty-string $recipient - * @since 35.0.0 + * @experimental 35.0.0 */ public function getRecipientInteractionReceiver(string $recipient): InteractionReceiver; } diff --git a/lib/public/Sharing/Recipient/IShareRecipientTypePublicSecret.php b/lib/unstable/Sharing/Recipient/IShareRecipientTypePublicSecret.php similarity index 83% rename from lib/public/Sharing/Recipient/IShareRecipientTypePublicSecret.php rename to lib/unstable/Sharing/Recipient/IShareRecipientTypePublicSecret.php index 59972d4567b66..dd1253d741f77 100644 --- a/lib/public/Sharing/Recipient/IShareRecipientTypePublicSecret.php +++ b/lib/unstable/Sharing/Recipient/IShareRecipientTypePublicSecret.php @@ -7,24 +7,24 @@ declare(strict_types=1); -namespace OCP\Sharing\Recipient; +namespace NCU\Sharing\Recipient; use OCP\AppFramework\Attribute\Implementable; /** - * @since 35.0.0 + * @experimental 35.0.0 */ #[Implementable(since: '35.0.0')] interface IShareRecipientTypePublicSecret extends IShareRecipientType { /** * @param non-empty-string $recipient - * @since 35.0.0 + * @experimental 35.0.0 */ public function isSecretPublic(string $recipient): bool; /** * @param non-empty-string $recipient - * @since 35.0.0 + * @experimental 35.0.0 */ public function isSecretUpdatable(string $recipient): bool; } diff --git a/lib/public/Sharing/Recipient/IShareRecipientTypeSearch.php b/lib/unstable/Sharing/Recipient/IShareRecipientTypeSearch.php similarity index 83% rename from lib/public/Sharing/Recipient/IShareRecipientTypeSearch.php rename to lib/unstable/Sharing/Recipient/IShareRecipientTypeSearch.php index 1c9f519b741ac..3ee1f6b9091e3 100644 --- a/lib/public/Sharing/Recipient/IShareRecipientTypeSearch.php +++ b/lib/unstable/Sharing/Recipient/IShareRecipientTypeSearch.php @@ -7,13 +7,13 @@ declare(strict_types=1); -namespace OCP\Sharing\Recipient; +namespace NCU\Sharing\Recipient; +use NCU\Sharing\ShareAccessContext; use OCP\AppFramework\Attribute\Implementable; -use OCP\Sharing\ShareAccessContext; /** - * @since 35.0.0 + * @experimental 35.0.0 */ #[Implementable(since: '35.0.0')] interface IShareRecipientTypeSearch extends IShareRecipientType { @@ -23,7 +23,7 @@ interface IShareRecipientTypeSearch extends IShareRecipientType { * @param positive-int $limit * @param non-negative-int $offset * @return list - * @since 35.0.0 + * @experimental 35.0.0 */ public function searchRecipients(ShareAccessContext $accessContext, string $query, int $limit, int $offset): array; } diff --git a/lib/public/Sharing/Recipient/ShareRecipient.php b/lib/unstable/Sharing/Recipient/ShareRecipient.php similarity index 93% rename from lib/public/Sharing/Recipient/ShareRecipient.php rename to lib/unstable/Sharing/Recipient/ShareRecipient.php index 0baf1dac40640..5ddb0fa8b294a 100644 --- a/lib/public/Sharing/Recipient/ShareRecipient.php +++ b/lib/unstable/Sharing/Recipient/ShareRecipient.php @@ -7,26 +7,26 @@ declare(strict_types=1); -namespace OCP\Sharing\Recipient; +namespace NCU\Sharing\Recipient; +use NCU\Sharing\Icon\ShareIconURL; +use NCU\Sharing\ISharingRegistry; +use NCU\Sharing\Share; +use NCU\Sharing\ShareUser; use OCP\AppFramework\Attribute\Consumable; use OCP\IURLGenerator; use OCP\IUserManager; use OCP\L10N\IFactory; -use OCP\Sharing\Icon\ShareIconURL; -use OCP\Sharing\ISharingRegistry; -use OCP\Sharing\Share; -use OCP\Sharing\ShareUser; use RuntimeException; /** * @psalm-import-type SharingRecipient from Share - * @since 35.0.0 + * @experimental 35.0.0 */ #[Consumable(since: '35.0.0')] final readonly class ShareRecipient { /** - * @since 35.0.0 + * @experimental 35.0.0 */ public function __construct( /** @var class-string $class */ @@ -46,7 +46,7 @@ public function __construct( /** * @return SharingRecipient - * @since 35.0.0 + * @experimental 35.0.0 */ public function format(ISharingRegistry $registry, IFactory $l10nFactory, IURLGenerator $urlGenerator, IUserManager $userManager, bool $isUnique): array { if (($recipientType = ($registry->getRecipientTypes()[$this->class] ?? null)) === null) { @@ -100,7 +100,7 @@ public function format(ISharingRegistry $registry, IFactory $l10nFactory, IURLGe /** * @param list $recipients * @return list - * @since 35.0.0 + * @experimental 35.0.0 */ public static function formatMultiple(ISharingRegistry $registry, IFactory $l10nFactory, IURLGenerator $urlGenerator, IUserManager $userManager, array $recipients): array { $recipientTypes = $registry->getRecipientTypes(); diff --git a/lib/public/Sharing/Share.php b/lib/unstable/Sharing/Share.php similarity index 94% rename from lib/public/Sharing/Share.php rename to lib/unstable/Sharing/Share.php index 054b4dc3b3b08..ed74a4f2bcb8f 100644 --- a/lib/public/Sharing/Share.php +++ b/lib/unstable/Sharing/Share.php @@ -7,21 +7,21 @@ declare(strict_types=1); -namespace OCP\Sharing; +namespace NCU\Sharing; +use NCU\Sharing\Permission\ISharePermissionPreset; +use NCU\Sharing\Permission\ISharePermissionType; +use NCU\Sharing\Permission\SharePermission; +use NCU\Sharing\Property\ISharePropertyType; +use NCU\Sharing\Property\ShareProperty; +use NCU\Sharing\Recipient\IShareRecipientType; +use NCU\Sharing\Recipient\ShareRecipient; +use NCU\Sharing\Source\IShareSourceType; +use NCU\Sharing\Source\ShareSource; use OCP\AppFramework\Attribute\Consumable; use OCP\IURLGenerator; use OCP\IUserManager; use OCP\L10N\IFactory; -use OCP\Sharing\Permission\ISharePermissionPreset; -use OCP\Sharing\Permission\ISharePermissionType; -use OCP\Sharing\Permission\SharePermission; -use OCP\Sharing\Property\ISharePropertyType; -use OCP\Sharing\Property\ShareProperty; -use OCP\Sharing\Recipient\IShareRecipientType; -use OCP\Sharing\Recipient\ShareRecipient; -use OCP\Sharing\Source\IShareSourceType; -use OCP\Sharing\Source\ShareSource; /** * Keep the following types in sync with apps/sharing/lib/ResponseDefinitions.php: @@ -140,7 +140,7 @@ * permission_preset: ?class-string, * } * - * @since 35.0.0 + * @experimental 35.0.0 */ #[Consumable(since: '35.0.0')] final class Share { @@ -148,7 +148,7 @@ final class Share { private ?array $enabledPermissions = null; /** - * @since 35.0.0 + * @experimental 35.0.0 */ public function __construct( /** @var non-empty-string $id */ @@ -170,7 +170,7 @@ public function __construct( /** * @return array, SharePermission> - * @since 35.0.0 + * @experimental 35.0.0 */ public function getEnabledPermissions(): array { return $this->enabledPermissions ??= array_filter($this->permissions, static fn (SharePermission $permission): bool => $permission->enabled); @@ -178,7 +178,7 @@ public function getEnabledPermissions(): array { /** * @return SharingShare - * @since 35.0.0 + * @experimental 35.0.0 */ public function format(ISharingRegistry $registry, IFactory $l10nFactory, IURLGenerator $urlGenerator, IUserManager $userManager): array { $properties = array_map(fn (ShareProperty $property): array => $property->format($registry, $l10nFactory, $this), array_values($this->properties)); @@ -253,7 +253,7 @@ public function format(ISharingRegistry $registry, IFactory $l10nFactory, IURLGe /** * @param list $shares * @return list - * @since 35.0.0 + * @experimental 35.0.0 */ public static function formatMultiple(ISharingRegistry $registry, IFactory $l10nFactory, IURLGenerator $urlGenerator, IUserManager $userManager, array $shares): array { // First sort by priority and then sort by share id to get a stable order regardless of the DB order diff --git a/lib/public/Sharing/ShareAccessContext.php b/lib/unstable/Sharing/ShareAccessContext.php similarity index 80% rename from lib/public/Sharing/ShareAccessContext.php rename to lib/unstable/Sharing/ShareAccessContext.php index 402433ae5f90d..92ea745359e5a 100644 --- a/lib/public/Sharing/ShareAccessContext.php +++ b/lib/unstable/Sharing/ShareAccessContext.php @@ -7,20 +7,20 @@ declare(strict_types=1); -namespace OCP\Sharing; +namespace NCU\Sharing; +use NCU\Sharing\Property\ISharePropertyTypeFilter; +use NCU\Sharing\Recipient\IShareRecipientType; use OCP\AppFramework\Attribute\Consumable; use OCP\IUser; -use OCP\Sharing\Property\ISharePropertyTypeFilter; -use OCP\Sharing\Recipient\IShareRecipientType; /** - * @since 35.0.0 + * @experimental 35.0.0 */ #[Consumable(since: '35.0.0')] final readonly class ShareAccessContext { /** - * @since 35.0.0 + * @experimental 35.0.0 */ public function __construct( public ?IUser $currentUser = null, diff --git a/lib/public/Sharing/ShareState.php b/lib/unstable/Sharing/ShareState.php similarity index 75% rename from lib/public/Sharing/ShareState.php rename to lib/unstable/Sharing/ShareState.php index 62edbeb5a7ce1..86b31237aaa84 100644 --- a/lib/public/Sharing/ShareState.php +++ b/lib/unstable/Sharing/ShareState.php @@ -7,25 +7,25 @@ declare(strict_types=1); -namespace OCP\Sharing; +namespace NCU\Sharing; use OCP\AppFramework\Attribute\Consumable; /** - * @since 35.0.0 + * @experimental 35.0.0 */ #[Consumable(since: '35.0.0')] enum ShareState: string { /** - * @since 35.0.0 + * @experimental 35.0.0 */ case Active = 'active'; /** - * @since 35.0.0 + * @experimental 35.0.0 */ case Draft = 'draft'; /** - * @since 35.0.0 + * @experimental 35.0.0 */ case Deleted = 'deleted'; } diff --git a/lib/public/Sharing/ShareUser.php b/lib/unstable/Sharing/ShareUser.php similarity index 91% rename from lib/public/Sharing/ShareUser.php rename to lib/unstable/Sharing/ShareUser.php index 42f399c5fb693..392eb870b122d 100644 --- a/lib/public/Sharing/ShareUser.php +++ b/lib/unstable/Sharing/ShareUser.php @@ -7,21 +7,21 @@ declare(strict_types=1); -namespace OCP\Sharing; +namespace NCU\Sharing; +use NCU\Sharing\Icon\ShareIconURL; use OCP\AppFramework\Attribute\Consumable; use OCP\IUserManager; -use OCP\Sharing\Icon\ShareIconURL; use RuntimeException; /** * @psalm-import-type SharingUser from Share - * @since 35.0.0 + * @experimental 35.0.0 */ #[Consumable(since: '35.0.0')] final readonly class ShareUser { /** - * @since 35.0.0 + * @experimental 35.0.0 */ public function __construct( /** @var non-empty-string $userId */ @@ -35,7 +35,7 @@ public function __construct( } /** - * @since 35.0.0 + * @experimental 35.0.0 */ public function isCurrentUser(ShareAccessContext $accessContext): bool { return $this->instance === null && $accessContext->currentUser?->getUID() === $this->userId; @@ -43,7 +43,7 @@ public function isCurrentUser(ShareAccessContext $accessContext): bool { /** * @return SharingUser - * @since 35.0.0 + * @experimental 35.0.0 */ public function format(IUserManager $userManager): array { if ($this->instance !== null) { diff --git a/lib/public/Sharing/Source/IShareSourceType.php b/lib/unstable/Sharing/Source/IShareSourceType.php similarity index 83% rename from lib/public/Sharing/Source/IShareSourceType.php rename to lib/unstable/Sharing/Source/IShareSourceType.php index a64500b8fb8d6..0cce43c89731d 100644 --- a/lib/public/Sharing/Source/IShareSourceType.php +++ b/lib/unstable/Sharing/Source/IShareSourceType.php @@ -7,16 +7,16 @@ declare(strict_types=1); -namespace OCP\Sharing\Source; +namespace NCU\Sharing\Source; +use NCU\Sharing\Icon\ShareIconSVG; +use NCU\Sharing\Icon\ShareIconURL; use OCP\AppFramework\Attribute\Implementable; use OCP\Interaction\InteractionResource; use OCP\L10N\IFactory; -use OCP\Sharing\Icon\ShareIconSVG; -use OCP\Sharing\Icon\ShareIconURL; /** - * @since 35.0.0 + * @experimental 35.0.0 */ #[Implementable(since: '35.0.0')] interface IShareSourceType { @@ -24,7 +24,7 @@ interface IShareSourceType { * Returns a user friendly display name for this source type. * * @return non-empty-string - * @since 35.0.0 + * @experimental 35.0.0 */ public function getDisplayName(IFactory $l10nFactory): string; @@ -34,27 +34,27 @@ public function getDisplayName(IFactory $l10nFactory): string; * Any check if the source is allowed to be accessed and shared, must be implemented through {@see RestrictInteractionEvent}. * * @param non-empty-string $source - * @since 35.0.0 + * @experimental 35.0.0 */ public function validateSource(string $source): bool; /** * @param non-empty-string $source * @return ?non-empty-string - * @since 35.0.0 + * @experimental 35.0.0 */ public function getSourceDisplayName(string $source): ?string; /** * @param non-empty-string $source - * @since 35.0.0 + * @experimental 35.0.0 */ public function getSourceIcon(string $source): null|ShareIconSVG|ShareIconURL; /** * @param non-empty-string $userId * @param non-empty-string $source - * @since 35.0.0 + * @experimental 35.0.0 */ public function getSourceInteractionResource(string $userId, string $source): InteractionResource; } diff --git a/lib/public/Sharing/Source/ShareSource.php b/lib/unstable/Sharing/Source/ShareSource.php similarity index 91% rename from lib/public/Sharing/Source/ShareSource.php rename to lib/unstable/Sharing/Source/ShareSource.php index b0c94c3c05ad8..00b519dfc858d 100644 --- a/lib/public/Sharing/Source/ShareSource.php +++ b/lib/unstable/Sharing/Source/ShareSource.php @@ -7,22 +7,22 @@ declare(strict_types=1); -namespace OCP\Sharing\Source; +namespace NCU\Sharing\Source; +use NCU\Sharing\ISharingRegistry; +use NCU\Sharing\Share; use OCP\AppFramework\Attribute\Consumable; use OCP\L10N\IFactory; -use OCP\Sharing\ISharingRegistry; -use OCP\Sharing\Share; use RuntimeException; /** * @psalm-import-type SharingSource from Share - * @since 35.0.0 + * @experimental 35.0.0 */ #[Consumable(since: '35.0.0')] final readonly class ShareSource { /** - * @since 35.0.0 + * @experimental 35.0.0 */ public function __construct( /** @var class-string $class */ @@ -34,7 +34,7 @@ public function __construct( /** * @return SharingSource - * @since 35.0.0 + * @experimental 35.0.0 */ public function format(ISharingRegistry $registry, IFactory $l10nFactory, bool $isUnique): array { if (($sourceType = ($registry->getSourceTypes()[$this->class] ?? null)) === null) { @@ -57,7 +57,7 @@ public function format(ISharingRegistry $registry, IFactory $l10nFactory, bool $ /** * @param list $sources * @return list - * @since 35.0.0 + * @experimental 35.0.0 */ public static function formatMultiple(ISharingRegistry $registry, IFactory $l10nFactory, array $sources): array { $sourceTypes = $registry->getSourceTypes(); diff --git a/psalm-strict.xml b/psalm-strict.xml index 6c8b59b92332b..c1b5dc95b0a22 100644 --- a/psalm-strict.xml +++ b/psalm-strict.xml @@ -45,7 +45,7 @@ - + diff --git a/tests/Core/Sharing/Property/ExpirationDateSharePropertyTypeTest.php b/tests/Core/Sharing/Property/ExpirationDateSharePropertyTypeTest.php index 48dba4e402b15..c64b1066a0d15 100644 --- a/tests/Core/Sharing/Property/ExpirationDateSharePropertyTypeTest.php +++ b/tests/Core/Sharing/Property/ExpirationDateSharePropertyTypeTest.php @@ -12,6 +12,12 @@ use DateInterval; use DateTimeImmutable; use DateTimeInterface; +use NCU\Sharing\Property\ShareProperty; +use NCU\Sharing\Recipient\ShareRecipient; +use NCU\Sharing\Share; +use NCU\Sharing\ShareAccessContext; +use NCU\Sharing\ShareState; +use NCU\Sharing\ShareUser; use OC\Core\AppInfo\Application; use OC\Core\Sharing\Property\ExpirationDateSharePropertyType; use OC\Core\Sharing\Recipient\EmailShareRecipientType; @@ -21,12 +27,6 @@ use OCP\IUser; use OCP\IUserManager; use OCP\Server; -use OCP\Sharing\Property\ShareProperty; -use OCP\Sharing\Recipient\ShareRecipient; -use OCP\Sharing\Share; -use OCP\Sharing\ShareAccessContext; -use OCP\Sharing\ShareState; -use OCP\Sharing\ShareUser; use PHPUnit\Framework\Attributes\DataProvider; use PHPUnit\Framework\Attributes\Group; use Test\TestCase; diff --git a/tests/Core/Sharing/Property/PasswordSharePropertyTypeTest.php b/tests/Core/Sharing/Property/PasswordSharePropertyTypeTest.php index db0645965ee45..9ee6d53f10a37 100644 --- a/tests/Core/Sharing/Property/PasswordSharePropertyTypeTest.php +++ b/tests/Core/Sharing/Property/PasswordSharePropertyTypeTest.php @@ -9,6 +9,11 @@ namespace Tests\Core\Sharing\Property; +use NCU\Sharing\Property\ShareProperty; +use NCU\Sharing\Share; +use NCU\Sharing\ShareAccessContext; +use NCU\Sharing\ShareState; +use NCU\Sharing\ShareUser; use OC\Core\AppInfo\Application; use OC\Core\AppInfo\ConfigLexicon; use OC\Core\Sharing\Property\PasswordSharePropertyType; @@ -18,11 +23,6 @@ use OCP\L10N\IFactory; use OCP\Security\IHasher; use OCP\Server; -use OCP\Sharing\Property\ShareProperty; -use OCP\Sharing\Share; -use OCP\Sharing\ShareAccessContext; -use OCP\Sharing\ShareState; -use OCP\Sharing\ShareUser; use PHPUnit\Framework\Attributes\Group; use Test\TestCase; diff --git a/tests/Core/Sharing/Recipient/EmailShareRecipientTypeTest.php b/tests/Core/Sharing/Recipient/EmailShareRecipientTypeTest.php index 8e04826a5c146..096ee91d1f524 100644 --- a/tests/Core/Sharing/Recipient/EmailShareRecipientTypeTest.php +++ b/tests/Core/Sharing/Recipient/EmailShareRecipientTypeTest.php @@ -9,6 +9,8 @@ namespace Core\Sharing\Recipient; +use NCU\Sharing\Recipient\ShareRecipient; +use NCU\Sharing\ShareAccessContext; use OC\Core\Sharing\Recipient\EmailShareRecipientType; use OC\User\Database; use OCA\DAV\CardDAV\CardDavBackend; @@ -17,8 +19,6 @@ use OCP\IUser; use OCP\IUserManager; use OCP\Server; -use OCP\Sharing\Recipient\ShareRecipient; -use OCP\Sharing\ShareAccessContext; use PHPUnit\Framework\Attributes\Group; use Test\TestCase; diff --git a/tests/Core/Sharing/Recipient/GroupShareRecipientTypeTest.php b/tests/Core/Sharing/Recipient/GroupShareRecipientTypeTest.php index e9af4005348b2..954e5835359a6 100644 --- a/tests/Core/Sharing/Recipient/GroupShareRecipientTypeTest.php +++ b/tests/Core/Sharing/Recipient/GroupShareRecipientTypeTest.php @@ -9,6 +9,10 @@ namespace Tests\Core\Sharing\Recipient; +use NCU\Sharing\ISharingManager; +use NCU\Sharing\ISharingRegistry; +use NCU\Sharing\Recipient\ShareRecipient; +use NCU\Sharing\ShareAccessContext; use OC\Core\Sharing\Recipient\GroupShareRecipientType; use OC\Group\Database; use OCA\Sharing\SharingBackend; @@ -19,10 +23,6 @@ use OCP\IUser; use OCP\IUserManager; use OCP\Server; -use OCP\Sharing\ISharingManager; -use OCP\Sharing\ISharingRegistry; -use OCP\Sharing\Recipient\ShareRecipient; -use OCP\Sharing\ShareAccessContext; use PHPUnit\Framework\Attributes\Group; use Test\TestCase; diff --git a/tests/Core/Sharing/Recipient/TeamShareRecipientTypeTest.php b/tests/Core/Sharing/Recipient/TeamShareRecipientTypeTest.php index a1c9c38a4018b..8b24d567c1655 100644 --- a/tests/Core/Sharing/Recipient/TeamShareRecipientTypeTest.php +++ b/tests/Core/Sharing/Recipient/TeamShareRecipientTypeTest.php @@ -9,6 +9,10 @@ namespace Tests\Core\Sharing\Recipient; +use NCU\Sharing\ISharingManager; +use NCU\Sharing\ISharingRegistry; +use NCU\Sharing\Recipient\ShareRecipient; +use NCU\Sharing\ShareAccessContext; use OC\Core\Sharing\Recipient\TeamShareRecipientType; use OCA\Circles\CirclesManager; use OCA\Circles\Exceptions\CircleNotFoundException; @@ -18,10 +22,6 @@ use OCP\IUser; use OCP\IUserManager; use OCP\Server; -use OCP\Sharing\ISharingManager; -use OCP\Sharing\ISharingRegistry; -use OCP\Sharing\Recipient\ShareRecipient; -use OCP\Sharing\ShareAccessContext; use OCP\Teams\ITeamManager; use OCP\Teams\Team; use PHPUnit\Framework\Attributes\Group; diff --git a/tests/Core/Sharing/Recipient/UserShareRecipientTypeTest.php b/tests/Core/Sharing/Recipient/UserShareRecipientTypeTest.php index 88b25f8e1bbb7..4cc6f232ea7c9 100644 --- a/tests/Core/Sharing/Recipient/UserShareRecipientTypeTest.php +++ b/tests/Core/Sharing/Recipient/UserShareRecipientTypeTest.php @@ -9,6 +9,10 @@ namespace Tests\Core\Sharing\Recipient; +use NCU\Sharing\ISharingManager; +use NCU\Sharing\ISharingRegistry; +use NCU\Sharing\Recipient\ShareRecipient; +use NCU\Sharing\ShareAccessContext; use OC\Core\Sharing\Recipient\UserShareRecipientType; use OC\User\Database; use OCA\Sharing\SharingBackend; @@ -17,10 +21,6 @@ use OCP\IUser; use OCP\IUserManager; use OCP\Server; -use OCP\Sharing\ISharingManager; -use OCP\Sharing\ISharingRegistry; -use OCP\Sharing\Recipient\ShareRecipient; -use OCP\Sharing\ShareAccessContext; use PHPUnit\Framework\Attributes\Group; use Test\TestCase; diff --git a/tests/lib/Sharing/AbstractSharingManagerTests.php b/tests/lib/Sharing/AbstractSharingManagerTests.php index b3420efc829f7..dddd33f6ed008 100644 --- a/tests/lib/Sharing/AbstractSharingManagerTests.php +++ b/tests/lib/Sharing/AbstractSharingManagerTests.php @@ -9,6 +9,15 @@ namespace Test\Sharing; +use NCU\Sharing\ISharingManager; +use NCU\Sharing\ISharingRegistry; +use NCU\Sharing\Permission\SharePermission; +use NCU\Sharing\Property\ShareProperty; +use NCU\Sharing\Recipient\ShareRecipient; +use NCU\Sharing\Share; +use NCU\Sharing\ShareAccessContext; +use NCU\Sharing\ShareState; +use NCU\Sharing\Source\ShareSource; use OC\Core\Sharing\Permission\ReshareSharePermissionType; use OCA\Sharing\SharingBackend; use OCP\EventDispatcher\IEventDispatcher; @@ -20,15 +29,6 @@ use OCP\IUser; use OCP\IUserManager; use OCP\Server; -use OCP\Sharing\ISharingManager; -use OCP\Sharing\ISharingRegistry; -use OCP\Sharing\Permission\SharePermission; -use OCP\Sharing\Property\ShareProperty; -use OCP\Sharing\Recipient\ShareRecipient; -use OCP\Sharing\Share; -use OCP\Sharing\ShareAccessContext; -use OCP\Sharing\ShareState; -use OCP\Sharing\Source\ShareSource; use PHPUnit\Framework\Attributes\DataProvider; use Test\TestCase; diff --git a/tests/lib/Sharing/Property/ABooleanSharePropertyTypeTest.php b/tests/lib/Sharing/Property/ABooleanSharePropertyTypeTest.php index a6ff9b858f43b..937dcc6773e86 100644 --- a/tests/lib/Sharing/Property/ABooleanSharePropertyTypeTest.php +++ b/tests/lib/Sharing/Property/ABooleanSharePropertyTypeTest.php @@ -9,12 +9,12 @@ namespace Test\Sharing\Property; +use NCU\Sharing\Property\ABooleanSharePropertyType; +use NCU\Sharing\Share; +use NCU\Sharing\ShareState; +use NCU\Sharing\ShareUser; use OCP\L10N\IFactory; use OCP\Server; -use OCP\Sharing\Property\ABooleanSharePropertyType; -use OCP\Sharing\Share; -use OCP\Sharing\ShareState; -use OCP\Sharing\ShareUser; use Test\TestCase; final class TestBooleanSharePropertyType extends ABooleanSharePropertyType { diff --git a/tests/lib/Sharing/Property/ADateSharePropertyTypeTest.php b/tests/lib/Sharing/Property/ADateSharePropertyTypeTest.php index 4d9d88b3e7d2f..158b475d147eb 100644 --- a/tests/lib/Sharing/Property/ADateSharePropertyTypeTest.php +++ b/tests/lib/Sharing/Property/ADateSharePropertyTypeTest.php @@ -12,12 +12,12 @@ use DateInterval; use DateTimeImmutable; use DateTimeInterface; +use NCU\Sharing\Property\ADateSharePropertyType; +use NCU\Sharing\Share; +use NCU\Sharing\ShareState; +use NCU\Sharing\ShareUser; use OCP\L10N\IFactory; use OCP\Server; -use OCP\Sharing\Property\ADateSharePropertyType; -use OCP\Sharing\Share; -use OCP\Sharing\ShareState; -use OCP\Sharing\ShareUser; use Test\TestCase; final class TestDateSharePropertyType extends ADateSharePropertyType { diff --git a/tests/lib/Sharing/Property/AEnumSharePropertyTypeTest.php b/tests/lib/Sharing/Property/AEnumSharePropertyTypeTest.php index 93e03b8e1d747..085617b22d41a 100644 --- a/tests/lib/Sharing/Property/AEnumSharePropertyTypeTest.php +++ b/tests/lib/Sharing/Property/AEnumSharePropertyTypeTest.php @@ -9,12 +9,12 @@ namespace Test\Sharing\Property; +use NCU\Sharing\Property\AEnumSharePropertyType; +use NCU\Sharing\Share; +use NCU\Sharing\ShareState; +use NCU\Sharing\ShareUser; use OCP\L10N\IFactory; use OCP\Server; -use OCP\Sharing\Property\AEnumSharePropertyType; -use OCP\Sharing\Share; -use OCP\Sharing\ShareState; -use OCP\Sharing\ShareUser; use Test\TestCase; final class TestEnumSharePropertyType extends AEnumSharePropertyType { diff --git a/tests/lib/Sharing/Property/APasswordSharePropertyTypeTest.php b/tests/lib/Sharing/Property/APasswordSharePropertyTypeTest.php index 737e26bfa5a10..c5deea86bbda9 100644 --- a/tests/lib/Sharing/Property/APasswordSharePropertyTypeTest.php +++ b/tests/lib/Sharing/Property/APasswordSharePropertyTypeTest.php @@ -9,16 +9,16 @@ namespace Test\Sharing\Property; +use NCU\Sharing\Property\APasswordSharePropertyType; +use NCU\Sharing\Share; +use NCU\Sharing\ShareState; +use NCU\Sharing\ShareUser; use OCP\EventDispatcher\IEventDispatcher; use OCP\HintException; use OCP\L10N\IFactory; use OCP\Security\Events\ValidatePasswordPolicyEvent; use OCP\Security\IHasher; use OCP\Server; -use OCP\Sharing\Property\APasswordSharePropertyType; -use OCP\Sharing\Share; -use OCP\Sharing\ShareState; -use OCP\Sharing\ShareUser; use RuntimeException; use Test\TestCase; diff --git a/tests/lib/Sharing/Property/AStringSharePropertyTypeTest.php b/tests/lib/Sharing/Property/AStringSharePropertyTypeTest.php index 31b691bed1431..fafe18ad11cd9 100644 --- a/tests/lib/Sharing/Property/AStringSharePropertyTypeTest.php +++ b/tests/lib/Sharing/Property/AStringSharePropertyTypeTest.php @@ -9,12 +9,12 @@ namespace Test\Sharing\Property; +use NCU\Sharing\Property\AStringSharePropertyType; +use NCU\Sharing\Share; +use NCU\Sharing\ShareState; +use NCU\Sharing\ShareUser; use OCP\L10N\IFactory; use OCP\Server; -use OCP\Sharing\Property\AStringSharePropertyType; -use OCP\Sharing\Share; -use OCP\Sharing\ShareState; -use OCP\Sharing\ShareUser; use Test\TestCase; final class TestStringSharePropertyType extends AStringSharePropertyType { diff --git a/tests/lib/Sharing/SharingManagerTest.php b/tests/lib/Sharing/SharingManagerTest.php index 519b60e1b6cc4..47db8ee2ec550 100644 --- a/tests/lib/Sharing/SharingManagerTest.php +++ b/tests/lib/Sharing/SharingManagerTest.php @@ -10,17 +10,17 @@ namespace Test\Sharing; use Exception; +use NCU\Sharing\Permission\SharePermission; +use NCU\Sharing\Property\ShareProperty; +use NCU\Sharing\Recipient\ShareRecipient; +use NCU\Sharing\Share; +use NCU\Sharing\ShareAccessContext; +use NCU\Sharing\ShareState; +use NCU\Sharing\Source\ShareSource; use OCP\IURLGenerator; use OCP\IUserManager; use OCP\L10N\IFactory; use OCP\Server; -use OCP\Sharing\Permission\SharePermission; -use OCP\Sharing\Property\ShareProperty; -use OCP\Sharing\Recipient\ShareRecipient; -use OCP\Sharing\Share; -use OCP\Sharing\ShareAccessContext; -use OCP\Sharing\ShareState; -use OCP\Sharing\Source\ShareSource; use PHPUnit\Framework\Attributes\Group; #[Group(name: 'DB')] diff --git a/tests/lib/Sharing/SharingRegistryTest.php b/tests/lib/Sharing/SharingRegistryTest.php index d78984ea644f3..6074a19866b15 100644 --- a/tests/lib/Sharing/SharingRegistryTest.php +++ b/tests/lib/Sharing/SharingRegistryTest.php @@ -9,8 +9,8 @@ namespace Test\Sharing; +use NCU\Sharing\ISharingRegistry; use OCP\Server; -use OCP\Sharing\ISharingRegistry; use RuntimeException; use Test\TestCase; diff --git a/tests/lib/Sharing/TestSharePermissionPreset1.php b/tests/lib/Sharing/TestSharePermissionPreset1.php index 529db4fd41617..a8b66a0f1a379 100644 --- a/tests/lib/Sharing/TestSharePermissionPreset1.php +++ b/tests/lib/Sharing/TestSharePermissionPreset1.php @@ -9,8 +9,8 @@ namespace Test\Sharing; +use NCU\Sharing\Permission\ISharePermissionPreset; use OCP\L10N\IFactory; -use OCP\Sharing\Permission\ISharePermissionPreset; class TestSharePermissionPreset1 implements ISharePermissionPreset { #[\Override] diff --git a/tests/lib/Sharing/TestSharePermissionType1.php b/tests/lib/Sharing/TestSharePermissionType1.php index 13d844f8eb2ff..e95942e21257d 100644 --- a/tests/lib/Sharing/TestSharePermissionType1.php +++ b/tests/lib/Sharing/TestSharePermissionType1.php @@ -9,8 +9,8 @@ namespace Test\Sharing; +use NCU\Sharing\Permission\ISharePermissionType; use OCP\L10N\IFactory; -use OCP\Sharing\Permission\ISharePermissionType; class TestSharePermissionType1 implements ISharePermissionType { #[\Override] diff --git a/tests/lib/Sharing/TestSharePropertyType1.php b/tests/lib/Sharing/TestSharePropertyType1.php index 771ed72ef8096..906db5f21036d 100644 --- a/tests/lib/Sharing/TestSharePropertyType1.php +++ b/tests/lib/Sharing/TestSharePropertyType1.php @@ -9,9 +9,9 @@ namespace Test\Sharing; +use NCU\Sharing\Property\AEnumSharePropertyType; +use NCU\Sharing\Share; use OCP\L10N\IFactory; -use OCP\Sharing\Property\AEnumSharePropertyType; -use OCP\Sharing\Share; class TestSharePropertyType1 extends AEnumSharePropertyType { public function __construct( diff --git a/tests/lib/Sharing/TestSharePropertyTypeFilter.php b/tests/lib/Sharing/TestSharePropertyTypeFilter.php index 5036147cb3420..d99fa75fd11c2 100644 --- a/tests/lib/Sharing/TestSharePropertyTypeFilter.php +++ b/tests/lib/Sharing/TestSharePropertyTypeFilter.php @@ -9,9 +9,9 @@ namespace Test\Sharing; -use OCP\Sharing\Property\ISharePropertyTypeFilter; -use OCP\Sharing\Share; -use OCP\Sharing\ShareAccessContext; +use NCU\Sharing\Property\ISharePropertyTypeFilter; +use NCU\Sharing\Share; +use NCU\Sharing\ShareAccessContext; final class TestSharePropertyTypeFilter extends TestSharePropertyType1 implements ISharePropertyTypeFilter { #[\Override] diff --git a/tests/lib/Sharing/TestSharePropertyTypeModifyValue.php b/tests/lib/Sharing/TestSharePropertyTypeModifyValue.php index a00ff4900f369..fd67691631bcd 100644 --- a/tests/lib/Sharing/TestSharePropertyTypeModifyValue.php +++ b/tests/lib/Sharing/TestSharePropertyTypeModifyValue.php @@ -9,8 +9,8 @@ namespace Test\Sharing; -use OCP\Sharing\Property\ISharePropertyTypeModifyValue; -use OCP\Sharing\Share; +use NCU\Sharing\Property\ISharePropertyTypeModifyValue; +use NCU\Sharing\Share; final class TestSharePropertyTypeModifyValue extends TestSharePropertyType1 implements ISharePropertyTypeModifyValue { diff --git a/tests/lib/Sharing/TestSharePropertyTypeRequired.php b/tests/lib/Sharing/TestSharePropertyTypeRequired.php index 778c55dce07eb..1e7b24169faea 100644 --- a/tests/lib/Sharing/TestSharePropertyTypeRequired.php +++ b/tests/lib/Sharing/TestSharePropertyTypeRequired.php @@ -9,7 +9,7 @@ namespace Test\Sharing; -use OCP\Sharing\Share; +use NCU\Sharing\Share; final class TestSharePropertyTypeRequired extends TestSharePropertyType1 { #[\Override] diff --git a/tests/lib/Sharing/TestShareRecipientType1.php b/tests/lib/Sharing/TestShareRecipientType1.php index b318ef3d3712d..9e7eeff2593ee 100644 --- a/tests/lib/Sharing/TestShareRecipientType1.php +++ b/tests/lib/Sharing/TestShareRecipientType1.php @@ -9,15 +9,15 @@ namespace Test\Sharing; +use NCU\Sharing\Icon\ShareIconSVG; +use NCU\Sharing\Icon\ShareIconURL; +use NCU\Sharing\Recipient\IShareRecipientType; +use NCU\Sharing\Recipient\IShareRecipientTypeSearch; +use NCU\Sharing\Recipient\ShareRecipient; +use NCU\Sharing\ShareAccessContext; use OCP\Interaction\InteractionReceiver; use OCP\IUser; use OCP\L10N\IFactory; -use OCP\Sharing\Icon\ShareIconSVG; -use OCP\Sharing\Icon\ShareIconURL; -use OCP\Sharing\Recipient\IShareRecipientType; -use OCP\Sharing\Recipient\IShareRecipientTypeSearch; -use OCP\Sharing\Recipient\ShareRecipient; -use OCP\Sharing\ShareAccessContext; class TestShareRecipientType1 implements IShareRecipientType, IShareRecipientTypeSearch { public function __construct( diff --git a/tests/lib/Sharing/TestShareRecipientTypeArguments.php b/tests/lib/Sharing/TestShareRecipientTypeArguments.php index 9f88319fd9122..61b944a5df091 100644 --- a/tests/lib/Sharing/TestShareRecipientTypeArguments.php +++ b/tests/lib/Sharing/TestShareRecipientTypeArguments.php @@ -9,12 +9,12 @@ namespace Test\Sharing; +use NCU\Sharing\Icon\ShareIconSVG; +use NCU\Sharing\Icon\ShareIconURL; +use NCU\Sharing\Recipient\IShareRecipientType; use OCP\Interaction\InteractionReceiver; use OCP\IUser; use OCP\L10N\IFactory; -use OCP\Sharing\Icon\ShareIconSVG; -use OCP\Sharing\Icon\ShareIconURL; -use OCP\Sharing\Recipient\IShareRecipientType; final class TestShareRecipientTypeArguments implements IShareRecipientType { #[\Override] diff --git a/tests/lib/Sharing/TestShareRecipientTypePublicSecret.php b/tests/lib/Sharing/TestShareRecipientTypePublicSecret.php index b50dc24695f67..f71714fa21ef1 100644 --- a/tests/lib/Sharing/TestShareRecipientTypePublicSecret.php +++ b/tests/lib/Sharing/TestShareRecipientTypePublicSecret.php @@ -9,13 +9,13 @@ namespace Test\Sharing; +use NCU\Sharing\Icon\ShareIconSVG; +use NCU\Sharing\Icon\ShareIconURL; +use NCU\Sharing\Recipient\IShareRecipientType; +use NCU\Sharing\Recipient\IShareRecipientTypePublicSecret; use OCP\Interaction\InteractionReceiver; use OCP\IUser; use OCP\L10N\IFactory; -use OCP\Sharing\Icon\ShareIconSVG; -use OCP\Sharing\Icon\ShareIconURL; -use OCP\Sharing\Recipient\IShareRecipientType; -use OCP\Sharing\Recipient\IShareRecipientTypePublicSecret; final readonly class TestShareRecipientTypePublicSecret implements IShareRecipientType, IShareRecipientTypePublicSecret { public function __construct( diff --git a/tests/lib/Sharing/TestShareSourceType1.php b/tests/lib/Sharing/TestShareSourceType1.php index 55b2e865607a7..e61bd869db945 100644 --- a/tests/lib/Sharing/TestShareSourceType1.php +++ b/tests/lib/Sharing/TestShareSourceType1.php @@ -9,11 +9,11 @@ namespace Test\Sharing; +use NCU\Sharing\Icon\ShareIconSVG; +use NCU\Sharing\Icon\ShareIconURL; +use NCU\Sharing\Source\IShareSourceType; use OCP\Interaction\InteractionResource; use OCP\L10N\IFactory; -use OCP\Sharing\Icon\ShareIconSVG; -use OCP\Sharing\Icon\ShareIconURL; -use OCP\Sharing\Source\IShareSourceType; class TestShareSourceType1 implements IShareSourceType { public function __construct(