Improve typing for fopen/toTmpFile

Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
This commit is contained in:
Côme Chilliet 2023-02-28 16:51:44 +01:00
parent 4393b96542
commit f974281ac9
No known key found for this signature in database
GPG key ID: A3E2F658B28C760A
3 changed files with 6 additions and 5 deletions

View file

@ -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);
}

View file

@ -80,7 +80,7 @@ class File extends Node implements \OCP\Files\File {
/**
* @param string $mode
* @return resource
* @return resource|false
* @throws NotPermittedException
* @throws LockedException
*/

View file

@ -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