-
Notifications
You must be signed in to change notification settings - Fork 8k
Promote warnings to exceptions in ext/gettext, ext/sysvmsg and ext/xml #5926
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
83dfe61 to
85a98d3
Compare
f8817aa to
26137e2
Compare
26137e2 to
ce010dd
Compare
|
CI failure is not related to these changes (apparently, 05c5c93#r41138411 caused it) |
|
@nikic I believe these errors promotions should be safe to do. Can I merge this PR? |
| } | ||
|
|
||
| PHP_GETTEXT_DOMAIN_LENGTH_CHECK(domain_len) | ||
| PHP_GETTEXT_DOMAIN_LENGTH_CHECK(2, domain_len) |
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.
| 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"); |
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.
| 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"); |
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.
| 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.
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 like these suggestion so went with them!
These warning promotions remove quite a few
falsereturn values.