summaryrefslogtreecommitdiffstats
path: root/lib/private/Preview/ProviderV2.php
diff options
context:
space:
mode:
authorCôme Chilliet <come.chilliet@nextcloud.com>2022-02-24 14:42:55 +0100
committerCôme Chilliet <come.chilliet@nextcloud.com>2022-02-24 14:42:55 +0100
commitebe731f01439d7a632c43a3994f2c0192e501ef0 (patch)
tree22a1c7741ccd20c9d424f7e580f06abcf730cfa6 /lib/private/Preview/ProviderV2.php
parent6da8a6d62adde9b1ed011a7a18d43984cf5a27a8 (diff)
downloadnextcloud-server-ebe731f01439d7a632c43a3994f2c0192e501ef0.tar.gz
nextcloud-server-ebe731f01439d7a632c43a3994f2c0192e501ef0.zip
Fix typing in OC\Preview
Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
Diffstat (limited to 'lib/private/Preview/ProviderV2.php')
-rw-r--r--lib/private/Preview/ProviderV2.php13
1 files changed, 9 insertions, 4 deletions
diff --git a/lib/private/Preview/ProviderV2.php b/lib/private/Preview/ProviderV2.php
index 4323f149702..766e00f074a 100644
--- a/lib/private/Preview/ProviderV2.php
+++ b/lib/private/Preview/ProviderV2.php
@@ -72,7 +72,7 @@ abstract class ProviderV2 implements IProviderV2 {
*/
abstract public function getThumbnail(File $file, int $maxX, int $maxY): ?IImage;
- protected function useTempFile(File $file) {
+ protected function useTempFile(File $file): bool {
return $file->isEncrypted() || !$file->getStorage()->isLocal();
}
@@ -81,9 +81,9 @@ abstract class ProviderV2 implements IProviderV2 {
*
* @param File $file
* @param int $maxSize maximum size for temporary files
- * @return string
+ * @return string|false
*/
- protected function getLocalFile(File $file, int $maxSize = null): string {
+ protected function getLocalFile(File $file, int $maxSize = null) {
if ($this->useTempFile($file)) {
$absPath = \OC::$server->getTempManager()->getTemporaryFile();
@@ -97,7 +97,12 @@ abstract class ProviderV2 implements IProviderV2 {
$this->tmpFiles[] = $absPath;
return $absPath;
} else {
- return $file->getStorage()->getLocalFile($file->getInternalPath());
+ $path = $file->getStorage()->getLocalFile($file->getInternalPath());
+ if (is_string($path)) {
+ return $path;
+ } else {
+ return false;
+ }
}
}