-
Notifications
You must be signed in to change notification settings - Fork 8k
add ZipArchive::LENGTH_TO_END and ZipArchive::LENGTH_UNCHECKED constants #11811
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
Conversation
ext/zip/php_zip.stub.php
Outdated
| * @var int | ||
| * @cvalue ZIP_LENGTH_TO_END | ||
| */ | ||
| public const LENGTH_TO_END = UNKNOWN; |
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.
you can now declare the constant types :) P.S.: Would you be OK to convert all ZipArchive class constants to typed?
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.
I prefer to not, as same code is also used for older PHP versions, and don't want to much diff.
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.
Btw, compat macro works, so done
Also in pecl pierrejoye/php_zip@f8abd19
ext/zip/php_zip.stub.php
Outdated
| /** | ||
| * @var int | ||
| */ | ||
| public const LENGTH_TO_END = 0; |
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.
please avoid declaring the same constant "twice" when possible as doing so may introduce problems to the generation of the manual AFAIR. E.g. You could conditionally declare ZIP_LENGTH_TO_END with the default value in the header file.
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.
done
|
LGTM |
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.
Only an upgrade note is needed, but LGTM!
ZipArchive::LENGTH_TO_ENDis always defined as 0ZipArchive::LENGTH_UNCHECKEDwill be defined with libzip 1.10.1 planned for AugustAlready in pecl/zip, will be in version 1.22.2 planned to be released immediately after libzip
I think this is better to have in 8.3 before RC