storage: update IStorage#file_put_contents docs to match usage

The current phpdoc of IStorage#file_put_contents doesnt corresponds to
it's actual usage in code, e.g.

Signed-off-by: Tigran Mkrtchyan <tigran.mkrtchyan@desy.de>
pull/24594/head
Tigran Mkrtchyan 3 years ago
parent f3513f3fe4
commit 4f2dc18f58

@ -439,9 +439,9 @@ class ObjectStoreStorage extends \OC\Files\Storage\Common {
public function file_put_contents($path, $data) {
$handle = $this->fopen($path, 'w+');
fwrite($handle, $data);
$result = fwrite($handle, $data);
fclose($handle);
return true;
return $result;
}
public function writeStream(string $path, $stream, int $size = null): int {

@ -486,8 +486,8 @@ class DAV extends Common {
/**
* @param string $path
* @param string $data
* @return int
* @param mixed $data
* @return int|false
*/
public function file_put_contents($path, $data) {
$path = $this->cleanPath($path);

@ -73,7 +73,11 @@ abstract class Flysystem extends Common {
* {@inheritdoc}
*/
public function file_put_contents($path, $data) {
return $this->flysystem->put($this->buildPath($path), $data);
$result = $this->flysystem->put($this->buildPath($path), $data);
if ($result === true) {
return strlen($data);
}
return $result;
}
/**

@ -309,8 +309,8 @@ class Encoding extends Wrapper {
* see http://php.net/manual/en/function.file_put_contents.php
*
* @param string $path
* @param string $data
* @return bool
* @param mixed $data
* @return int|false
*/
public function file_put_contents($path, $data) {
return $this->storage->file_put_contents($this->findPathToUse($path), $data);

@ -234,8 +234,8 @@ class Encryption extends Wrapper {
* see http://php.net/manual/en/function.file_put_contents.php
*
* @param string $path
* @param string $data
* @return bool
* @param mixed $data
* @return int|false
*/
public function file_put_contents($path, $data) {
// file put content will always be translated to a stream write

@ -259,8 +259,8 @@ class Jail extends Wrapper {
* see http://php.net/manual/en/function.file_put_contents.php
*
* @param string $path
* @param string $data
* @return bool
* @param mixed $data
* @return int|false
*/
public function file_put_contents($path, $data) {
return $this->getWrapperStorage()->file_put_contents($this->getUnjailedPath($path), $data);

@ -121,8 +121,8 @@ class Quota extends Wrapper {
* see http://php.net/manual/en/function.file_put_contents.php
*
* @param string $path
* @param string $data
* @return bool
* @param mixed $data
* @return int|false
*/
public function file_put_contents($path, $data) {
$free = $this->free_space($path);

@ -250,8 +250,8 @@ class Wrapper implements \OC\Files\Storage\Storage, ILockingStorage, IWriteStrea
* see http://php.net/manual/en/function.file_put_contents.php
*
* @param string $path
* @param string $data
* @return bool
* @param mixed $data
* @return int|false
*/
public function file_put_contents($path, $data) {
return $this->getWrapperStorage()->file_put_contents($path, $data);

@ -230,8 +230,8 @@ interface Storage extends IStorage {
* see http://php.net/manual/en/function.file_put_contents.php
*
* @param string $path
* @param string $data
* @return bool
* @param mixed $data
* @return int|false
* @since 6.0.0
*/
public function file_put_contents($path, $data);

@ -226,8 +226,8 @@ interface IStorage {
* see http://php.net/manual/en/function.file_put_contents.php
*
* @param string $path
* @param string $data
* @return bool
* @param mixed $data
* @return int|false
* @since 9.0.0
*/
public function file_put_contents($path, $data);

Loading…
Cancel
Save