aboutsummaryrefslogtreecommitdiffstats
path: root/lib/private/Files/Storage/LocalTempFileTrait.php
diff options
context:
space:
mode:
authorCôme Chilliet <come.chilliet@nextcloud.com>2023-03-13 18:59:16 +0100
committerCôme Chilliet <come.chilliet@nextcloud.com>2023-04-03 10:52:34 +0200
commitea05544213b6d472338684e9c7bae66f68453c58 (patch)
tree809724b54187a4d21fbe967b38b10fc4cb4ca38a /lib/private/Files/Storage/LocalTempFileTrait.php
parentf974281ac9a086004c7e971f3585ed8aa21d194d (diff)
downloadnextcloud-server-ea05544213b6d472338684e9c7bae66f68453c58.tar.gz
nextcloud-server-ea05544213b6d472338684e9c7bae66f68453c58.zip
Fix return type of methods returning false on error
Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
Diffstat (limited to 'lib/private/Files/Storage/LocalTempFileTrait.php')
-rw-r--r--lib/private/Files/Storage/LocalTempFileTrait.php16
1 files changed, 4 insertions, 12 deletions
diff --git a/lib/private/Files/Storage/LocalTempFileTrait.php b/lib/private/Files/Storage/LocalTempFileTrait.php
index 2ac0a74b692..314e38cb277 100644
--- a/lib/private/Files/Storage/LocalTempFileTrait.php
+++ b/lib/private/Files/Storage/LocalTempFileTrait.php
@@ -35,14 +35,10 @@ namespace OC\Files\Storage;
* in classes which extend it, e.g. $this->stat() .
*/
trait LocalTempFileTrait {
- /** @var string[] */
- protected $cachedFiles = [];
+ /** @var array<string,string|false> */
+ protected array $cachedFiles = [];
- /**
- * @param string $path
- * @return string
- */
- protected function getCachedFile($path) {
+ protected function getCachedFile(string $path): string|false {
if (!isset($this->cachedFiles[$path])) {
$this->cachedFiles[$path] = $this->toTmpFile($path);
}
@@ -56,11 +52,7 @@ trait LocalTempFileTrait {
unset($this->cachedFiles[$path]);
}
- /**
- * @param string $path
- * @return string
- */
- protected function toTmpFile($path) { //no longer in the storage api, still useful here
+ protected function toTmpFile(string $path): string|false { //no longer in the storage api, still useful here
$source = $this->fopen($path, 'r');
if (!$source) {
return false;