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
parent
commit
308fcf4526
No known key found for this signature in database GPG Key ID: A3E2F658B28C760A
  1. 2
      apps/files_external/lib/Lib/Storage/FTP.php
  2. 2
      lib/private/Files/Storage/Common.php
  3. 2
      lib/private/Files/Storage/FailedStorage.php
  4. 2
      lib/private/Files/Storage/Local.php
  5. 2
      lib/private/Files/Storage/Wrapper/Availability.php
  6. 2
      lib/private/Files/Storage/Wrapper/Encoding.php
  7. 2
      lib/private/Files/Storage/Wrapper/Encryption.php
  8. 2
      lib/private/Files/Storage/Wrapper/Jail.php
  9. 2
      lib/private/Files/Storage/Wrapper/Wrapper.php
  10. 2
      lib/private/Lockdown/Filesystem/NullStorage.php

2
apps/files_external/lib/Lib/Storage/FTP.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)); $result = $this->getConnection()->size($this->buildPath($path));
if ($result === -1) { if ($result === -1) {
return false; return false;

2
lib/private/Files/Storage/Common.php

@ -121,7 +121,7 @@ abstract class Common implements Storage, ILockingStorage, IWriteStreamStorage {
return $this->filetype($path) === 'file'; 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)) { if ($this->is_dir($path)) {
return 0; //by definition return 0; //by definition
} else { } else {

2
lib/private/Files/Storage/FailedStorage.php

@ -80,7 +80,7 @@ class FailedStorage extends Common {
throw new StorageNotAvailableException($this->e->getMessage(), $this->e->getCode(), $this->e); 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); throw new StorageNotAvailableException($this->e->getMessage(), $this->e->getCode(), $this->e);
} }

2
lib/private/Files/Storage/Local.php

@ -242,7 +242,7 @@ class Local extends \OC\Files\Storage\Common {
return $filetype; return $filetype;
} }
public function filesize(string $path): false|int|float {
public function filesize($path): false|int|float {
if (!$this->is_file($path)) { if (!$this->is_file($path)) {
return 0; return 0;
} }

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

@ -165,7 +165,7 @@ class Availability extends Wrapper {
} }
/** {@inheritdoc} */ /** {@inheritdoc} */
public function filesize(string $path): false|int|float {
public function filesize($path): false|int|float {
$this->checkAvailability(); $this->checkAvailability();
try { try {
return parent::filesize($path); return parent::filesize($path);

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

@ -211,7 +211,7 @@ class Encoding extends Wrapper {
* see https://www.php.net/manual/en/function.filesize.php * see https://www.php.net/manual/en/function.filesize.php
* The result for filesize when called on a folder is required to be 0 * 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)); return $this->storage->filesize($this->findPathToUse($path));
} }

2
lib/private/Files/Storage/Wrapper/Encryption.php

@ -134,7 +134,7 @@ class Encryption extends Wrapper {
* see https://www.php.net/manual/en/function.filesize.php * see https://www.php.net/manual/en/function.filesize.php
* The result for filesize when called on a folder is required to be 0 * 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); $fullPath = $this->getFullPath($path);
/** @var CacheEntry $info */ /** @var CacheEntry $info */

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

@ -159,7 +159,7 @@ class Jail extends Wrapper {
* see https://www.php.net/manual/en/function.filesize.php * see https://www.php.net/manual/en/function.filesize.php
* The result for filesize when called on a folder is required to be 0 * 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)); return $this->getWrapperStorage()->filesize($this->getUnjailedPath($path));
} }

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

@ -149,7 +149,7 @@ class Wrapper implements \OC\Files\Storage\Storage, ILockingStorage, IWriteStrea
* see https://www.php.net/manual/en/function.filesize.php * see https://www.php.net/manual/en/function.filesize.php
* The result for filesize when called on a folder is required to be 0 * 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); return $this->getWrapperStorage()->filesize($path);
} }

2
lib/private/Lockdown/Filesystem/NullStorage.php

@ -65,7 +65,7 @@ class NullStorage extends Common {
return ($path === '') ? 'dir' : false; 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'); throw new \OC\ForbiddenException('This request is not allowed to access the filesystem');
} }

Loading…
Cancel
Save