Skip to content
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

fix(IStorage): Use false instead of bool intersection type to match implementations #48219

Open
wants to merge 6 commits into
base: master
Choose a base branch
from

Conversation

provokateurin
Copy link
Member

Summary

This adds strong return types to all implementations to match the interface.
The changes escalated a bit, but everything should be fixed at once.
It also fixes some bugs in poorly implemented storages.

Technically this is a breaking change due to changing the signature, but I only did that for private classes and the fix is completely backwards compatible.
The temporary pain of adding the return types to all implementations is justified by fixing all these type mismatches for once.
This change should also allow us to actually add the strong return types to IStorage since all implementations should also be extending Common which already has them.
Please don't hate me for this change 🙈

I was not able to test files_external due to the terrible test setup which I can not get working locally, so let's see what CI has to say.

Checklist

@provokateurin provokateurin added this to the Nextcloud 31 milestone Sep 19, 2024
@provokateurin provokateurin changed the title fix(files_trashbin): Fix all IStorage return types fix(IStorage): Use false instead of bool intersection type to match implementations Sep 19, 2024
Copy link

@github-advanced-security github-advanced-security bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Psalm found more than 20 potential problems in the proposed changes. Check the Files changed tab for more details.

Copy link
Contributor

@come-nc come-nc left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

To be continued…

apps/files_external/lib/Lib/Storage/AmazonS3.php Outdated Show resolved Hide resolved
apps/files_external/lib/Lib/Storage/AmazonS3.php Outdated Show resolved Hide resolved
apps/files_external/lib/Lib/Storage/FTP.php Show resolved Hide resolved
apps/files_external/lib/Lib/Storage/FTP.php Outdated Show resolved Hide resolved
apps/files_external/lib/Lib/Storage/FTP.php Outdated Show resolved Hide resolved
apps/files_external/lib/Lib/Storage/SFTP.php Outdated Show resolved Hide resolved
apps/files_external/lib/Lib/Storage/SFTP.php Outdated Show resolved Hide resolved
apps/files_external/lib/Lib/Storage/SMB.php Outdated Show resolved Hide resolved
apps/files_external/lib/Lib/Storage/Swift.php Outdated Show resolved Hide resolved
@provokateurin
Copy link
Member Author

I hope I fixed all the weird typings, but please take another look.

Signed-off-by: provokateurin <kate@provokateurin.de>
Signed-off-by: provokateurin <kate@provokateurin.de>
Signed-off-by: provokateurin <kate@provokateurin.de>
Signed-off-by: provokateurin <kate@provokateurin.de>
Signed-off-by: provokateurin <kate@provokateurin.de>
…mplementations

Signed-off-by: provokateurin <kate@provokateurin.de>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants