Uh oh!
There was an error while loading. Please reload this page.
Promote warnings to exceptions in ext/gettext, ext/sysvmsg and ext/xml - #5926
Closed
kocsismate wants to merge 1 commit into
Closed
Promote warnings to exceptions in ext/gettext, ext/sysvmsg and ext/xml#5926kocsismate wants to merge 1 commit into
kocsismate wants to merge 1 commit into
Conversation
kocsismateforce-pushed
the
warning-promo
branch
4 times, most recently
from
August 3, 2020 08:09
f8817aa to
26137e2Comparekocsismate
commented
Aug 3, 2020
MemberAuthor
CI failure is not related to these changes (apparently, 05c5c93#r41138411 caused it) |
kocsismate
commented
Aug 3, 2020
MemberAuthor
@nikic I believe these errors promotions should be safe to do. Can I merge this PR? |
nikic
approved these changes
Aug 3, 2020
| } | ||
| PHP_GETTEXT_DOMAIN_LENGTH_CHECK(domain_len) | ||
| PHP_GETTEXT_DOMAIN_LENGTH_CHECK(2, domain_len) |
Member
There was a problem hiding this comment.
Suggested change
| PHP_GETTEXT_DOMAIN_LENGTH_CHECK(2, domain_len) | |
| PHP_GETTEXT_DOMAIN_LENGTH_CHECK(1, domain_len) |
| } else { | ||
| php_error_docref(NULL, E_WARNING, "Unsupported source encoding \"%s\"", encoding_param); | ||
| RETURN_FALSE; | ||
| zend_argument_value_error(1, "is an unsupported source encoding"); |
Member
There was a problem hiding this comment.
Suggested change
| zend_argument_value_error(1, "is an unsupported source encoding"); | |
| zend_argument_value_error(1, "is not a supported source encoding"); |
...maybe? This reads nicer to me, but your version is also ok.
| default: | ||
| php_error_docref(NULL, E_WARNING, "Unknown option"); | ||
| RETURN_FALSE; | ||
| zend_argument_value_error(2, "must be one of PHP_XML_OPTION_CASE_FOLDING, PHP_XML_OPTION_SKIP_TAGSTART, PHP_XML_OPTION_SKIP_WHITE, PHP_XML_OPTION_TARGET_ENCODING"); |
Member
There was a problem hiding this comment.
Suggested change
| zend_argument_value_error(2, "must be one of PHP_XML_OPTION_CASE_FOLDING, PHP_XML_OPTION_SKIP_TAGSTART, PHP_XML_OPTION_SKIP_WHITE, PHP_XML_OPTION_TARGET_ENCODING"); | |
| zend_argument_value_error(2, "must be a PHP_XML_OPTION_* constant"); |
or similar. I think we should not list out all possible values in cases such as these.
MemberAuthor
There was a problem hiding this comment.
I like these suggestion so went with them!
71 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for freeto join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
These warning promotions remove quite a few
falsereturn values.