-
-
Notifications
You must be signed in to change notification settings - Fork 4.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
files: Local#writeStream should use it's own file_put_contents #24594
Conversation
The OC\Files\Storage\Local#writeStream use system provided file_put_contents. However, it overrides file_put_contents, thus expects that the default behaviour can be different. Use Local#file_put_contents in writeStream to benefit from class specific functionality. Signed-off-by: Tigran Mkrtchyan <tigran.mkrtchyan@desy.de>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes makes sense.
Psalm is not happy about that. Actually the annotation of file_put_contents in server/lib/public/Files/Storage/IStorage.php Line 229 in 5bf3d1b
resource instead of a string and we'd need to cast the return value of writeStream to be an integer.
|
Ok. I can fix that. |
As in other places it used as systems |
Yeah, that would indeed be the correct one 👍 |
2fe6090
to
c7aabba
Compare
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>
Thanks a lot 🎉 |
The OC\Files\Storage\Local#writeStream use system provided file_put_contents.
However, it overrides file_put_contents, thus expects that the default behaviour
can be different.
Use Local#file_put_contents in writeStream to benefit from class specific functionality.
Signed-off-by: Tigran Mkrtchyan tigran.mkrtchyan@desy.de