-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
[Form] Check for Intl availibility #28610
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
@@ -41,6 +42,10 @@ public function configureOptions(OptionsResolver $resolver) | |||
{ | |||
$resolver->setDefaults(array( | |||
'choice_loader' => function (Options $options) { | |||
if (!class_exists(Intl::class)) { | |||
throw new LogicException('The "symfony/intl" component is required to use the Country type.'); | |||
} |
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.
Could we move this to IntlCallbackChoiceLoader
instead?
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.
the message would be less obvious.. currently it hints Country type
etc.
@@ -41,6 +42,10 @@ public function configureOptions(OptionsResolver $resolver) | |||
{ | |||
$resolver->setDefaults(array( | |||
'choice_loader' => function (Options $options) { | |||
if (!class_exists(Intl::class)) { | |||
throw new LogicException('The "symfony/intl" component is required to use the Country type.'); |
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 would prefer LanguageType:class
, to get the FQCN here, same for the other exceptions
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.
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.
but @OskarStark's suggestion to enhance the message sounds good to me
Thank you @ro0NL. |
This PR was merged into the 4.2-dev branch. Discussion ---------- [Form] Check for Intl availibility | Q | A | ------------- | --- | Branch? | master | Bug fix? | no | New feature? | yes | BC breaks? | no <!-- see https://symfony.com/bc --> | Deprecations? | no | Tests pass? | yes <!-- please add some, will be required by reviewers --> | Fixed tickets | #... <!-- #-prefixed issue number(s), if any --> | License | MIT | Doc PR | symfony/symfony-docs#... <!-- required for new features --> Same as #28513 for the form component Commits ------- 73c688c [Form] Check for Intl availibility
…(ro0NL)" (chalasr) This PR was merged into the 4.2 branch. Discussion ---------- Revert "minor #28610 [Form] Check for Intl availibility (ro0NL)" | Q | A | ------------- | --- | Branch? | 4.2 | Bug fix? | no | New feature? | no | BC breaks? | no | Deprecations? | no | Tests pass? | yes | Fixed tickets | n/a | License | MIT | Doc PR | n/a Intl is an hard dependency for Form, these checks cannot be reached. Commits ------- 3ac98a6 Revert "minor #28610 [Form] Check for Intl availibility (ro0NL)"
* 4.2: Ensure final input of CommandTester works with default Do not risk waiting 100 seconds [Intl] handle null date and time types Revert "minor #28610 [Form] Check for Intl availibility (ro0NL)" Do not ignore the choice groups for caching
Same as #28513 for the form component