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

ext/phar: changing few methods returning true to void ones. #10804

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

devnexen
Copy link
Member

@devnexen devnexen commented Mar 7, 2023

No description provided.

@devnexen devnexen force-pushed the phar_stub_update branch 3 times, most recently from 4ca8287 to 8f78edd Compare March 7, 2023 21:50
@devnexen devnexen marked this pull request as ready for review March 8, 2023 20:59
@devnexen devnexen requested a review from kocsismate March 8, 2023 20:59
Copy link
Member

@kocsismate kocsismate left a comment

Choose a reason for hiding this comment

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

Overall, these are risky changes. In case of IntlDateformatter::setTimeZone, the return type change made more sense, since the new return value is part of the return type. But in case of these phar methods, a completely different type is going to be returned. I don't think we should do this in a minor version, but I'd be ok to "deprecate" the true returns in PHP 8.3, and then make these methods void in PHP 9.0. I'm not sure about the best course of action though. E.g. we could use the RETURN_VALUE_USED macro to emit a deprecation notice. Unfortunately, this doesn't always work. :(

@@ -112,7 +112,7 @@ public function buildFromIterator(Traversable $iterator, ?string $baseDirectory
public function compressFiles(int $compression): void {}

/** @return bool */
public function decompressFiles() {} // TODO make return type void
public function decompressFiles(): void {}
Copy link
Member

@kocsismate kocsismate Mar 9, 2023

Choose a reason for hiding this comment

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

IMO these shouldn't be made native type declarations first so that the type declarations users already have can be fixed easier.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants