Skip to content

Promote warning to ValueError for Spoofchecker::setRestrictionLevel() #6197

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

Closed

Conversation

Girgias
Copy link
Member

@Girgias Girgias commented Sep 23, 2020

@kocsismate is this error message fine? Or do you have a better idea on how to integrate the Spoofchecker::UNRESTRICTIVE constant with the other 4?

@@ -143,8 +143,8 @@ PHP_METHOD(Spoofchecker, setRestrictionLevel)
USPOOF_MODERATELY_RESTRICTIVE != level &&
USPOOF_MINIMALLY_RESTRICTIVE != level &&
USPOOF_UNRESTRICTIVE != level) {
php_error_docref(NULL, E_WARNING, "Invalid restriction level value");
return;
zend_argument_value_error(1, "must be one of the Spoofchecker::*_RESTRICTIVE constants or Spoofchecker::UNRESTRICTIVE");
Copy link
Member

Choose a reason for hiding this comment

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

Seems tricky :) In this case, you could just list them all, 4 items don't seem too many for me. If the list gets too long, then just write "is invalid". Problem solved! :D

@Girgias Girgias force-pushed the intl-spoofchecker-warning-to-error branch from 9e4d357 to dafb18b Compare September 25, 2020 15:57
@php-pulls php-pulls closed this in a91cb2f Sep 25, 2020
@Girgias Girgias deleted the intl-spoofchecker-warning-to-error branch September 25, 2020 16:56
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.

3 participants