Skip to content

Commit

Permalink
fix(DirMask): Fix return types
Browse files Browse the repository at this point in the history
Signed-off-by: provokateurin <kate@provokateurin.de>
  • Loading branch information
provokateurin committed Oct 1, 2024
1 parent 3825770 commit 86d0107
Show file tree
Hide file tree
Showing 2 changed files with 165 additions and 109 deletions.
25 changes: 4 additions & 21 deletions lib/Storage/DirMask.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
namespace OCA\Guests\Storage;

use OC\Files\Storage\Wrapper\PermissionsMask;
use OCP\Files\Cache\ICache;

/**
* While PermissionMask can mask a whole storage this can
Expand Down Expand Up @@ -100,9 +101,6 @@ public function getPermissions($path): int {
}
}

/**
* @psalm-suppress ParamNameMismatch
*/
public function rename($source, $target): bool {
if (!$this->isUpdatable($source)) {
return false;
Expand All @@ -123,9 +121,6 @@ public function rename($source, $target): bool {
return false;
}

/**
* @psalm-suppress ParamNameMismatch
*/
public function copy($source, $target): bool {
if (!$this->isReadable($source)) {
return false;
Expand Down Expand Up @@ -162,10 +157,7 @@ public function mkdir($path): bool {
}
}

/**
* @psalm-suppress MethodSignatureMustProvideReturnType
*/
public function rmdir($path) {
public function rmdir($path): bool {
if ($this->checkPath($path)) {
return parent::rmdir($path);
} else {
Expand All @@ -181,20 +173,14 @@ public function unlink($path): bool {
}
}

/**
* @psalm-suppress MethodSignatureMustProvideReturnType
*/
public function file_put_contents($path, $data) {
public function file_put_contents($path, $data): int|float|false {
if ($this->checkPath($path)) {
return parent::file_put_contents($path, $data);
} else {
return $this->storage->file_put_contents($path, $data);
}
}

/**
* @psalm-suppress MethodSignatureMustProvideReturnType
*/
public function fopen($path, $mode) {
if ($this->checkPath($path)) {
return parent::fopen($path, $mode);
Expand All @@ -203,10 +189,7 @@ public function fopen($path, $mode) {
}
}

/**
* @psalm-suppress MethodSignatureMustProvideReturnType
*/
public function getCache($path = '', $storage = null) {
public function getCache($path = '', $storage = null): ICache {
if (!$storage) {
$storage = $this;
}
Expand Down
Loading

0 comments on commit 86d0107

Please sign in to comment.