-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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
Change interface return for getSize in FileInfo to string #28605
Conversation
Hmm, doesn't We'll see what CI says |
Hmm, it passed I will try to identify places where getSize() is used and check if that is correct there |
My problem here is that the size is supposed to be an The reason size is sometimes a string is only due to PHP on 32-bit. So I'd expect the PHPDoc to say "int". Not sure how to deal with this on interface level, we could add "int|string" but it's ugly. @DeepDiver1975 can you help make a cut here ? |
To clarify, interface returns |
@DeepDiver1975 any cut here and in #28275. This interface anyways previously was returning sometimes int and simetimes string, so as unit tests and integration tests passed it seems it can work with returning numeric strings only.. |
@jvillafanez @individual-it if you guys all agree that this change will not break any apps due to the way PHP handles these values then I'm fine getting this in OC 10.0.3 |
From my point of view, this needs a full regression testing, including apps. In addition, we're changing the interface to something a bit worse and kind of unexpected (for a good reason, of course), so this will very likely require changes in 3rdparty apps. Unless really really critical, I'd delay this for the next big version |
I don't think it's critical to have return values matching the interface documentation at this point. So a possible plan would be to:
|
Something like this shows the differences:
output:
An "interesting" case from backward compatibility is that if you passed it "2b" then you used to get back 2 and now you get back "0". The other cases are either functionally equivalent return values, or the new one is better - e.g. for the big numbers that overflow maxint. |
@mrow4a the way I understood it so far is that the size can only be a string if running on PHP on 32-bit system and the value is bigger than 32-bit max int. But the screenshot above seems to show that sometimes it's a string even for small values ?! If that is really the case then we need to find the code paths that create these string values. For the short term I suggest reverting your old PR to get back the old way. |
revert PR here for the short term: #28649 |
Open if you think this is relevant (64-bit support only) |
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
Fixes issue #28275