1010
1111use OC \Files \Filesystem ;
1212use OC \Files \Mount \MountPoint ;
13- use OC \Files \Mount \MoveableMount ;
1413use OCA \Files_Sharing \Exceptions \BrokenPath ;
1514use OCP \EventDispatcher \IEventDispatcher ;
1615use OCP \Files \Events \InvalidateMountCacheEvent ;
16+ use OCP \Files \Mount \IMovableMount ;
1717use OCP \Files \Storage \IStorageFactory ;
1818use OCP \IDBConnection ;
1919use OCP \IUser ;
2020use OCP \Server ;
2121use OCP \Share \IShare ;
22+ use Override ;
2223use Psr \Log \LoggerInterface ;
2324
2425/**
2526 * Shared mount points can be moved by the user
2627 */
27- class SharedMount extends MountPoint implements MoveableMount, ISharedMountPoint {
28- /** @var ?SharedStorage $storage */
28+ class SharedMount extends MountPoint implements IMovableMount, ISharedMountPoint {
29+ /**
30+ * @var ?SharedStorage $storage
31+ */
2932 protected $ storage = null ;
3033
3134 /** @var IShare */
@@ -74,7 +77,7 @@ private function updateFileTarget($newPath, &$share) {
7477 * @return string e.g. turns '/admin/files/test.txt' into '/test.txt'
7578 * @throws BrokenPath
7679 */
77- protected function stripUserFilesPath ($ path ) {
80+ protected function stripUserFilesPath (string $ path ): string {
7881 $ trimmed = ltrim ($ path , '/ ' );
7982 $ split = explode ('/ ' , $ trimmed );
8083
@@ -91,13 +94,8 @@ protected function stripUserFilesPath($path) {
9194 return '/ ' . $ relPath ;
9295 }
9396
94- /**
95- * Move the mount point to $target
96- *
97- * @param string $target the target mount point
98- * @return bool
99- */
100- public function moveMount ($ target ) {
97+ #[Override]
98+ public function moveMount (string $ target ): bool {
10199 $ relTargetPath = $ this ->stripUserFilesPath ($ target );
102100 $ share = $ this ->storage ->getShare ();
103101
@@ -120,12 +118,8 @@ public function moveMount($target) {
120118 return $ result ;
121119 }
122120
123- /**
124- * Remove the mount points
125- *
126- * @return bool
127- */
128- public function removeMount () {
121+ #[Override]
122+ public function removeMount (): bool {
129123 $ mountManager = Filesystem::getMountManager ();
130124 /** @var SharedStorage $storage */
131125 $ storage = $ this ->getStorage ();
@@ -181,7 +175,8 @@ public function getNumericStorageId() {
181175 }
182176 }
183177
184- public function getMountType () {
178+ #[Override]
179+ public function getMountType (): string {
185180 return 'shared ' ;
186181 }
187182
0 commit comments