Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 9 additions & 7 deletions lib/Filesystem/StorageWrapper.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,9 @@
namespace OCA\TermsOfService\Filesystem;

use OC\Files\Storage\Wrapper\Wrapper;
use OCP\Files\Cache\ICache;
use OCP\Files\ForbiddenException;
use OCP\Files\Storage\IStorage;

class StorageWrapper extends Wrapper {
/** @var string */
Expand All @@ -22,47 +24,47 @@ public function __construct($parameters) {
$this->helper = new Helper($parameters['checker'], $this->mountPoint);
}

public function isCreatable($path) {
public function isCreatable(string $path): bool {
if(!$this->helper->verifyAccess($path)) {
return false;
}

return $this->storage->isCreatable($path);
}

public function isUpdatable($path) {
public function isUpdatable(string $path): bool {
if(!$this->helper->verifyAccess($path)) {
return false;
}

return $this->storage->isUpdatable($path);
}

public function isDeletable($path) {
public function isDeletable(string $path): bool {
if(!$this->helper->verifyAccess($path)) {
return false;
}

return $this->storage->isDeletable($path);
}

public function isReadable($path) {
public function isReadable(string $path): bool {
if(!$this->helper->verifyAccess($path)) {
return false;
}

return $this->storage->isReadable($path);
}

public function isSharable($path) {
public function isSharable(string $path): bool {
if(!$this->helper->verifyAccess($path)) {
return false;
}

return $this->storage->isReadable($path);
}

public function fopen($path, $mode) {
public function fopen(string $path, string $mode) {
if ($this->helper->verifyAccess($path)) {
return $this->storage->fopen($path, $mode);
}
Expand All @@ -77,7 +79,7 @@ public function fopen($path, $mode) {
* @param \OC\Files\Storage\Storage (optional) the storage to pass to the cache
* @return \OC\Files\Cache\Cache
*/
public function getCache($path = '', $storage = null) {
public function getCache(string $path = '', ?IStorage $storage = null): ICache {
if (!$storage) {
$storage = $this;
}
Expand Down