Browse Source
Respect OCP interface in private classes
Because the parameter type was moved to phpdoc it needs to be removed
from implementations
Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
pull/36120/head
Côme Chilliet
3 years ago
No known key found for this signature in database
GPG Key ID: A3E2F658B28C760A
10 changed files with
10 additions and
10 deletions
-
apps/files_external/lib/Lib/Storage/FTP.php
-
lib/private/Files/Storage/Common.php
-
lib/private/Files/Storage/FailedStorage.php
-
lib/private/Files/Storage/Local.php
-
lib/private/Files/Storage/Wrapper/Availability.php
-
lib/private/Files/Storage/Wrapper/Encoding.php
-
lib/private/Files/Storage/Wrapper/Encryption.php
-
lib/private/Files/Storage/Wrapper/Jail.php
-
lib/private/Files/Storage/Wrapper/Wrapper.php
-
lib/private/Lockdown/Filesystem/NullStorage.php
|
|
|
@ -140,7 +140,7 @@ class FTP extends Common { |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
public function filesize(string $path): false|int|float { |
|
|
|
public function filesize($path): false|int|float { |
|
|
|
$result = $this->getConnection()->size($this->buildPath($path)); |
|
|
|
if ($result === -1) { |
|
|
|
return false; |
|
|
|
|
|
|
|
@ -121,7 +121,7 @@ abstract class Common implements Storage, ILockingStorage, IWriteStreamStorage { |
|
|
|
return $this->filetype($path) === 'file'; |
|
|
|
} |
|
|
|
|
|
|
|
public function filesize(string $path): false|int|float { |
|
|
|
public function filesize($path): false|int|float { |
|
|
|
if ($this->is_dir($path)) { |
|
|
|
return 0; //by definition
|
|
|
|
} else { |
|
|
|
|
|
|
|
@ -80,7 +80,7 @@ class FailedStorage extends Common { |
|
|
|
throw new StorageNotAvailableException($this->e->getMessage(), $this->e->getCode(), $this->e); |
|
|
|
} |
|
|
|
|
|
|
|
public function filesize(string $path): false|int|float { |
|
|
|
public function filesize($path): false|int|float { |
|
|
|
throw new StorageNotAvailableException($this->e->getMessage(), $this->e->getCode(), $this->e); |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
@ -242,7 +242,7 @@ class Local extends \OC\Files\Storage\Common { |
|
|
|
return $filetype; |
|
|
|
} |
|
|
|
|
|
|
|
public function filesize(string $path): false|int|float { |
|
|
|
public function filesize($path): false|int|float { |
|
|
|
if (!$this->is_file($path)) { |
|
|
|
return 0; |
|
|
|
} |
|
|
|
|
|
|
|
@ -165,7 +165,7 @@ class Availability extends Wrapper { |
|
|
|
} |
|
|
|
|
|
|
|
/** {@inheritdoc} */ |
|
|
|
public function filesize(string $path): false|int|float { |
|
|
|
public function filesize($path): false|int|float { |
|
|
|
$this->checkAvailability(); |
|
|
|
try { |
|
|
|
return parent::filesize($path); |
|
|
|
|
|
|
|
@ -211,7 +211,7 @@ class Encoding extends Wrapper { |
|
|
|
* see https://www.php.net/manual/en/function.filesize.php |
|
|
|
* The result for filesize when called on a folder is required to be 0 |
|
|
|
*/ |
|
|
|
public function filesize(string $path): false|int|float { |
|
|
|
public function filesize($path): false|int|float { |
|
|
|
return $this->storage->filesize($this->findPathToUse($path)); |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
@ -134,7 +134,7 @@ class Encryption extends Wrapper { |
|
|
|
* see https://www.php.net/manual/en/function.filesize.php |
|
|
|
* The result for filesize when called on a folder is required to be 0 |
|
|
|
*/ |
|
|
|
public function filesize(string $path): false|int|float { |
|
|
|
public function filesize($path): false|int|float { |
|
|
|
$fullPath = $this->getFullPath($path); |
|
|
|
|
|
|
|
/** @var CacheEntry $info */ |
|
|
|
|
|
|
|
@ -159,7 +159,7 @@ class Jail extends Wrapper { |
|
|
|
* see https://www.php.net/manual/en/function.filesize.php |
|
|
|
* The result for filesize when called on a folder is required to be 0 |
|
|
|
*/ |
|
|
|
public function filesize(string $path): false|int|float { |
|
|
|
public function filesize($path): false|int|float { |
|
|
|
return $this->getWrapperStorage()->filesize($this->getUnjailedPath($path)); |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
@ -149,7 +149,7 @@ class Wrapper implements \OC\Files\Storage\Storage, ILockingStorage, IWriteStrea |
|
|
|
* see https://www.php.net/manual/en/function.filesize.php |
|
|
|
* The result for filesize when called on a folder is required to be 0 |
|
|
|
*/ |
|
|
|
public function filesize(string $path): false|int|float { |
|
|
|
public function filesize($path): false|int|float { |
|
|
|
return $this->getWrapperStorage()->filesize($path); |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
@ -65,7 +65,7 @@ class NullStorage extends Common { |
|
|
|
return ($path === '') ? 'dir' : false; |
|
|
|
} |
|
|
|
|
|
|
|
public function filesize(string $path): false|int|float { |
|
|
|
public function filesize($path): false|int|float { |
|
|
|
throw new \OC\ForbiddenException('This request is not allowed to access the filesystem'); |
|
|
|
} |
|
|
|
|
|
|
|
|