diff options
author | Côme Chilliet <come.chilliet@nextcloud.com> | 2023-02-28 16:51:44 +0100 |
---|---|---|
committer | Côme Chilliet <come.chilliet@nextcloud.com> | 2023-04-03 10:52:34 +0200 |
commit | f974281ac9a086004c7e971f3585ed8aa21d194d (patch) | |
tree | 905ec041b013c46efe97fdac272d0864f003707f | |
parent | 4393b96542be6b0495d93cf9ed87e9b51b36121f (diff) | |
download | nextcloud-server-f974281ac9a086004c7e971f3585ed8aa21d194d.tar.gz nextcloud-server-f974281ac9a086004c7e971f3585ed8aa21d194d.zip |
Improve typing for fopen/toTmpFile
Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
-rw-r--r-- | lib/private/Files/Filesystem.php | 7 | ||||
-rw-r--r-- | lib/private/Files/Node/File.php | 2 | ||||
-rw-r--r-- | lib/public/Files/File.php | 2 |
3 files changed, 6 insertions, 5 deletions
diff --git a/lib/private/Files/Filesystem.php b/lib/private/Files/Filesystem.php index ee8db5b4353..74205351e60 100644 --- a/lib/private/Files/Filesystem.php +++ b/lib/private/Files/Filesystem.php @@ -390,7 +390,7 @@ class Filesystem { /** * get the relative path of the root data directory for the current user * - * @return string + * @return ?string * * Returns path like /admin/files */ @@ -584,9 +584,10 @@ class Filesystem { } /** - * @return string + * @param string $path + * @throws \OCP\Files\InvalidPathException */ - public static function toTmpFile($path) { + public static function toTmpFile($path): string|false { return self::$defaultInstance->toTmpFile($path); } diff --git a/lib/private/Files/Node/File.php b/lib/private/Files/Node/File.php index 475930b361a..27056efef72 100644 --- a/lib/private/Files/Node/File.php +++ b/lib/private/Files/Node/File.php @@ -80,7 +80,7 @@ class File extends Node implements \OCP\Files\File { /** * @param string $mode - * @return resource + * @return resource|false * @throws NotPermittedException * @throws LockedException */ diff --git a/lib/public/Files/File.php b/lib/public/Files/File.php index cdb868241b6..93d0ab860c1 100644 --- a/lib/public/Files/File.php +++ b/lib/public/Files/File.php @@ -68,7 +68,7 @@ interface File extends Node { * Open the file as stream, resulting resource can be operated as stream like the result from php's own fopen * * @param string $mode - * @return resource + * @return resource|false * @throws NotPermittedException * @throws LockedException * @since 6.0.0 |