parent::__construct($parameters);
}
- public function unlink($path): bool {
+ public function unlink(string $path): bool {
if ($this->trashEnabled) {
try {
return $this->doDelete($path, 'unlink');
}
}
- public function rmdir($path): bool {
+ public function rmdir(string $path): bool {
if ($this->trashEnabled) {
return $this->doDelete($path, 'rmdir');
} else {
/**
* check if it is a file located in data/user/files only files in the
* 'files' directory should be moved to the trash
- *
- * @param $path
- * @return bool
*/
- protected function shouldMoveToTrash($path): bool {
+ protected function shouldMoveToTrash(string $path): bool {
$normalized = Filesystem::normalizePath($this->mountPoint . '/' . $path);
$parts = explode('/', $normalized);
if (count($parts) < 4 || strpos($normalized, '/appdata_') === 0) {
*
* @return bool true if the operation succeeded, false otherwise
*/
- private function doDelete($path, $method): bool {
+ private function doDelete(string $path, string $method): bool {
if (
!\OC::$server->getAppManager()->isEnabledForUser('files_trashbin')
|| (pathinfo($path, PATHINFO_EXTENSION) === 'part')
return $this->mountPoint;
}
- public function moveFromStorage(IStorage $sourceStorage, $sourceInternalPath, $targetInternalPath): bool {
+ public function moveFromStorage(IStorage $sourceStorage, string $sourceInternalPath, string $targetInternalPath): bool {
$sourceIsTrashbin = $sourceStorage->instanceOfStorage(Storage::class);
try {
// the fallback for moving between storage involves a copy+delete
use Test\Traits\MountProviderTrait;
class TemporaryNoCross extends Temporary {
- public function copyFromStorage(IStorage $sourceStorage, $sourceInternalPath, $targetInternalPath, $preserveMtime = null): bool {
+ public function copyFromStorage(IStorage $sourceStorage, string $sourceInternalPath, string $targetInternalPath, ?bool $preserveMtime = null): bool {
return Common::copyFromStorage($sourceStorage, $sourceInternalPath, $targetInternalPath, $preserveMtime);
}
- public function moveFromStorage(IStorage $sourceStorage, $sourceInternalPath, $targetInternalPath): bool {
+ public function moveFromStorage(IStorage $sourceStorage, string $sourceInternalPath, string $targetInternalPath): bool {
return Common::moveFromStorage($sourceStorage, $sourceInternalPath, $targetInternalPath);
}
}