Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Improve typing for fopen/toTmpFile
Signed-off-by: Côme Chilliet <[email protected]>
  • Loading branch information
come-nc committed Apr 3, 2023
commit f974281ac9a086004c7e971f3585ed8aa21d194d
7 changes: 4 additions & 3 deletions lib/private/Files/Filesystem.php
Original file line number Diff line number Diff line change
Expand Up @@ -390,7 +390,7 @@ public static function tearDown() {
/**
* get the relative path of the root data directory for the current user
*
* @return string
* @return ?string
*
* Returns path like /admin/files
*/
Expand Down Expand Up @@ -584,9 +584,10 @@ public static function fopen($path, $mode) {
}

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

Expand Down
2 changes: 1 addition & 1 deletion lib/private/Files/Node/File.php
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ public function putContent($data) {

/**
* @param string $mode
* @return resource
* @return resource|false
* @throws NotPermittedException
* @throws LockedException
*/
Expand Down
2 changes: 1 addition & 1 deletion lib/public/Files/File.php
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ public function getMimeType();
* 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
Expand Down