Skip to content

Commit 4e64a6e

Browse files
Merge pull request #48080 from nextcloud/fix/storage/method-docs-inheritance
2 parents 57a5baa + d2d1e32 commit 4e64a6e

12 files changed

Lines changed: 16 additions & 176 deletions

File tree

apps/files_sharing/lib/External/Storage.php

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -137,11 +137,6 @@ public function getCache($path = '', $storage = null) {
137137
return $this->cache;
138138
}
139139

140-
/**
141-
* @param string $path
142-
* @param \OC\Files\Storage\Storage $storage
143-
* @return \OCA\Files_Sharing\External\Scanner
144-
*/
145140
public function getScanner($path = '', $storage = null) {
146141
if (!$storage) {
147142
$storage = $this;

apps/files_sharing/lib/SharedStorage.php

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -488,12 +488,6 @@ public function unshareStorage(): bool {
488488
return true;
489489
}
490490

491-
/**
492-
* @param string $path
493-
* @param int $type \OCP\Lock\ILockingProvider::LOCK_SHARED or \OCP\Lock\ILockingProvider::LOCK_EXCLUSIVE
494-
* @param \OCP\Lock\ILockingProvider $provider
495-
* @throws \OCP\Lock\LockedException
496-
*/
497491
public function acquireLock($path, $type, ILockingProvider $provider) {
498492
/** @var ILockingStorage $targetStorage */
499493
[$targetStorage, $targetInternalPath] = $this->resolvePath($path);
@@ -505,11 +499,6 @@ public function acquireLock($path, $type, ILockingProvider $provider) {
505499
}
506500
}
507501

508-
/**
509-
* @param string $path
510-
* @param int $type \OCP\Lock\ILockingProvider::LOCK_SHARED or \OCP\Lock\ILockingProvider::LOCK_EXCLUSIVE
511-
* @param \OCP\Lock\ILockingProvider $provider
512-
*/
513502
public function releaseLock($path, $type, ILockingProvider $provider) {
514503
/** @var ILockingStorage $targetStorage */
515504
[$targetStorage, $targetInternalPath] = $this->resolvePath($path);
@@ -521,11 +510,6 @@ public function releaseLock($path, $type, ILockingProvider $provider) {
521510
}
522511
}
523512

524-
/**
525-
* @param string $path
526-
* @param int $type \OCP\Lock\ILockingProvider::LOCK_SHARED or \OCP\Lock\ILockingProvider::LOCK_EXCLUSIVE
527-
* @param \OCP\Lock\ILockingProvider $provider
528-
*/
529513
public function changeLock($path, $type, ILockingProvider $provider) {
530514
/** @var ILockingStorage $targetStorage */
531515
[$targetStorage, $targetInternalPath] = $this->resolvePath($path);

lib/private/Files/ObjectStore/ObjectStoreStorage.php

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -129,10 +129,6 @@ private function normalizePath($path) {
129129
/**
130130
* Object Stores use a NoopScanner because metadata is directly stored in
131131
* the file cache and cannot really scan the filesystem. The storage passed in is not used anywhere.
132-
*
133-
* @param string $path
134-
* @param \OC\Files\Storage\Storage (optional) the storage to pass to the scanner
135-
* @return \OC\Files\ObjectStore\ObjectStoreScanner
136132
*/
137133
public function getScanner($path = '', $storage = null) {
138134
if (!$storage) {

lib/private/Files/Storage/Common.php

Lines changed: 1 addition & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -347,19 +347,14 @@ public function getWatcher($path = '', $storage = null) {
347347
return $this->watcher;
348348
}
349349

350-
/**
351-
* get a propagator instance for the cache
352-
*
353-
* @param \OC\Files\Storage\Storage $storage (optional) the storage to pass to the watcher
354-
* @return Propagator
355-
*/
356350
public function getPropagator($storage = null) {
357351
if (!$storage) {
358352
$storage = $this;
359353
}
360354
if (!$storage->instanceOfStorage(self::class)) {
361355
throw new \InvalidArgumentException('Storage is not of the correct class');
362356
}
357+
/** @var self $storage */
363358
if (!isset($storage->propagator)) {
364359
$config = \OC::$server->getSystemConfig();
365360
$storage->propagator = new Propagator($storage, \OC::$server->getDatabaseConnection(), ['appdata_' . $config->getValue('instanceid')]);
@@ -649,9 +644,6 @@ public function moveFromStorage(IStorage $sourceStorage, $sourceInternalPath, $t
649644
return $result;
650645
}
651646

652-
/**
653-
* @inheritdoc
654-
*/
655647
public function getMetaData($path) {
656648
if (Filesystem::isFileBlacklisted($path)) {
657649
throw new ForbiddenException('Invalid path: ' . $path, false);
@@ -682,12 +674,6 @@ public function getMetaData($path) {
682674
return $data;
683675
}
684676

685-
/**
686-
* @param string $path
687-
* @param int $type \OCP\Lock\ILockingProvider::LOCK_SHARED or \OCP\Lock\ILockingProvider::LOCK_EXCLUSIVE
688-
* @param \OCP\Lock\ILockingProvider $provider
689-
* @throws \OCP\Lock\LockedException
690-
*/
691677
public function acquireLock($path, $type, ILockingProvider $provider) {
692678
$logger = $this->getLockLogger();
693679
if ($logger) {
@@ -715,12 +701,6 @@ public function acquireLock($path, $type, ILockingProvider $provider) {
715701
}
716702
}
717703

718-
/**
719-
* @param string $path
720-
* @param int $type \OCP\Lock\ILockingProvider::LOCK_SHARED or \OCP\Lock\ILockingProvider::LOCK_EXCLUSIVE
721-
* @param \OCP\Lock\ILockingProvider $provider
722-
* @throws \OCP\Lock\LockedException
723-
*/
724704
public function releaseLock($path, $type, ILockingProvider $provider) {
725705
$logger = $this->getLockLogger();
726706
if ($logger) {
@@ -748,12 +728,6 @@ public function releaseLock($path, $type, ILockingProvider $provider) {
748728
}
749729
}
750730

751-
/**
752-
* @param string $path
753-
* @param int $type \OCP\Lock\ILockingProvider::LOCK_SHARED or \OCP\Lock\ILockingProvider::LOCK_EXCLUSIVE
754-
* @param \OCP\Lock\ILockingProvider $provider
755-
* @throws \OCP\Lock\LockedException
756-
*/
757731
public function changeLock($path, $type, ILockingProvider $provider) {
758732
$logger = $this->getLockLogger();
759733
if ($logger) {

lib/private/Files/Storage/Home.php

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -56,12 +56,6 @@ public function getCache($path = '', $storage = null) {
5656
return $this->cache;
5757
}
5858

59-
/**
60-
* get a propagator instance for the cache
61-
*
62-
* @param \OC\Files\Storage\Storage $storage (optional) the storage to pass to the watcher
63-
* @return \OC\Files\Cache\Propagator
64-
*/
6559
public function getPropagator($storage = null) {
6660
if (!$storage) {
6761
$storage = $this;

lib/private/Files/Storage/Local.php

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -164,9 +164,6 @@ public function stat($path) {
164164
return $statResult;
165165
}
166166

167-
/**
168-
* @inheritdoc
169-
*/
170167
public function getMetaData($path) {
171168
try {
172169
$stat = $this->stat($path);

lib/private/Files/Storage/Storage.php

Lines changed: 15 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,11 @@
88

99
namespace OC\Files\Storage;
1010

11+
use OC\Files\Cache\Cache;
12+
use OC\Files\Cache\Propagator;
13+
use OC\Files\Cache\Scanner;
14+
use OC\Files\Cache\Updater;
15+
use OC\Files\Cache\Watcher;
1116
use OCP\Files\Storage\ILockingStorage;
1217
use OCP\Files\Storage\IStorage;
1318

@@ -18,45 +23,32 @@
1823
*/
1924
interface Storage extends IStorage, ILockingStorage {
2025
/**
21-
* get a cache instance for the storage
22-
*
23-
* @param string $path
24-
* @param \OC\Files\Storage\Storage|null (optional) the storage to pass to the cache
25-
* @return \OC\Files\Cache\Cache
26+
* @inheritDoc
27+
* @return Cache
2628
*/
2729
public function getCache($path = '', $storage = null);
2830

2931
/**
30-
* get a scanner instance for the storage
31-
*
32-
* @param string $path
33-
* @param \OC\Files\Storage\Storage (optional) the storage to pass to the scanner
34-
* @return \OC\Files\Cache\Scanner
32+
* @inheritDoc
33+
* @return Scanner
3534
*/
3635
public function getScanner($path = '', $storage = null);
3736

3837
/**
39-
* get a watcher instance for the cache
40-
*
41-
* @param string $path
42-
* @param \OC\Files\Storage\Storage (optional) the storage to pass to the watcher
43-
* @return \OC\Files\Cache\Watcher
38+
* @inheritDoc
39+
* @return Watcher
4440
*/
4541
public function getWatcher($path = '', $storage = null);
4642

4743
/**
48-
* get a propagator instance for the cache
49-
*
50-
* @param \OC\Files\Storage\Storage (optional) the storage to pass to the watcher
51-
* @return \OC\Files\Cache\Propagator
44+
* @inheritDoc
45+
* @return Propagator
5246
*/
5347
public function getPropagator($storage = null);
5448

5549
/**
56-
* get a updater instance for the cache
57-
*
58-
* @param \OC\Files\Storage\Storage (optional) the storage to pass to the watcher
59-
* @return \OC\Files\Cache\Updater
50+
* @inheritDoc
51+
* @return Updater
6052
*/
6153
public function getUpdater($storage = null);
6254

lib/private/Files/Storage/Wrapper/Availability.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -422,7 +422,6 @@ public function moveFromStorage(IStorage $sourceStorage, $sourceInternalPath, $t
422422
}
423423
}
424424

425-
/** {@inheritdoc} */
426425
public function getMetaData($path) {
427426
$this->checkAvailability();
428427
try {

lib/private/Files/Storage/Wrapper/Encoding.php

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -418,27 +418,13 @@ public function hasUpdated($path, $time) {
418418
return $this->storage->hasUpdated($this->findPathToUse($path), $time);
419419
}
420420

421-
/**
422-
* get a cache instance for the storage
423-
*
424-
* @param string $path
425-
* @param \OC\Files\Storage\Storage (optional) the storage to pass to the cache
426-
* @return \OC\Files\Cache\Cache
427-
*/
428421
public function getCache($path = '', $storage = null) {
429422
if (!$storage) {
430423
$storage = $this;
431424
}
432425
return $this->storage->getCache($this->findPathToUse($path), $storage);
433426
}
434427

435-
/**
436-
* get a scanner instance for the storage
437-
*
438-
* @param string $path
439-
* @param \OC\Files\Storage\Storage (optional) the storage to pass to the scanner
440-
* @return \OC\Files\Cache\Scanner
441-
*/
442428
public function getScanner($path = '', $storage = null) {
443429
if (!$storage) {
444430
$storage = $this;

lib/private/Files/Storage/Wrapper/Jail.php

Lines changed: 0 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -358,13 +358,6 @@ public function hasUpdated($path, $time) {
358358
return $this->getWrapperStorage()->hasUpdated($this->getUnjailedPath($path), $time);
359359
}
360360

361-
/**
362-
* get a cache instance for the storage
363-
*
364-
* @param string $path
365-
* @param \OC\Files\Storage\Storage|null (optional) the storage to pass to the cache
366-
* @return \OC\Files\Cache\Cache
367-
*/
368361
public function getCache($path = '', $storage = null) {
369362
$sourceCache = $this->getWrapperStorage()->getCache($this->getUnjailedPath($path));
370363
return new CacheJail($sourceCache, $this->rootPath);
@@ -374,13 +367,6 @@ public function getOwner($path): string|false {
374367
return $this->getWrapperStorage()->getOwner($this->getUnjailedPath($path));
375368
}
376369

377-
/**
378-
* get a watcher instance for the cache
379-
*
380-
* @param string $path
381-
* @param \OC\Files\Storage\Storage (optional) the storage to pass to the watcher
382-
* @return \OC\Files\Cache\Watcher
383-
*/
384370
public function getWatcher($path = '', $storage = null) {
385371
$sourceWatcher = $this->getWrapperStorage()->getWatcher($this->getUnjailedPath($path), $this->getWrapperStorage());
386372
return new JailWatcher($sourceWatcher, $this->rootPath);
@@ -400,30 +386,14 @@ public function getMetaData($path) {
400386
return $this->getWrapperStorage()->getMetaData($this->getUnjailedPath($path));
401387
}
402388

403-
/**
404-
* @param string $path
405-
* @param int $type \OCP\Lock\ILockingProvider::LOCK_SHARED or \OCP\Lock\ILockingProvider::LOCK_EXCLUSIVE
406-
* @param \OCP\Lock\ILockingProvider $provider
407-
* @throws \OCP\Lock\LockedException
408-
*/
409389
public function acquireLock($path, $type, ILockingProvider $provider) {
410390
$this->getWrapperStorage()->acquireLock($this->getUnjailedPath($path), $type, $provider);
411391
}
412392

413-
/**
414-
* @param string $path
415-
* @param int $type \OCP\Lock\ILockingProvider::LOCK_SHARED or \OCP\Lock\ILockingProvider::LOCK_EXCLUSIVE
416-
* @param \OCP\Lock\ILockingProvider $provider
417-
*/
418393
public function releaseLock($path, $type, ILockingProvider $provider) {
419394
$this->getWrapperStorage()->releaseLock($this->getUnjailedPath($path), $type, $provider);
420395
}
421396

422-
/**
423-
* @param string $path
424-
* @param int $type \OCP\Lock\ILockingProvider::LOCK_SHARED or \OCP\Lock\ILockingProvider::LOCK_EXCLUSIVE
425-
* @param \OCP\Lock\ILockingProvider $provider
426-
*/
427397
public function changeLock($path, $type, ILockingProvider $provider) {
428398
$this->getWrapperStorage()->changeLock($this->getUnjailedPath($path), $type, $provider);
429399
}

0 commit comments

Comments
 (0)