Skip to content
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

[Form] Check for Intl availibility #28610

Merged
merged 1 commit into from
Sep 29, 2018
Merged

[Form] Check for Intl availibility #28610

merged 1 commit into from
Sep 29, 2018

Conversation

ro0NL
Copy link
Contributor

@ro0NL ro0NL commented Sep 26, 2018

Q A
Branch? master
Bug fix? no
New feature? yes
BC breaks? no
Deprecations? no
Tests pass? yes
Fixed tickets #...
License MIT
Doc PR symfony/symfony-docs#...

Same as #28513 for the form component

@@ -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.');
}
Copy link
Member

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?

Copy link
Contributor Author

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.');
Copy link
Contributor

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

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done.

@xabbuh xabbuh added this to the next milestone Sep 28, 2018
Copy link
Member

@xabbuh xabbuh left a 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

@fabpot
Copy link
Member

fabpot commented Sep 29, 2018

Thank you @ro0NL.

@fabpot fabpot merged commit 73c688c into symfony:master Sep 29, 2018
fabpot added a commit that referenced this pull request Sep 29, 2018
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 ro0NL deleted the form branch September 29, 2018 07:26
@nicolas-grekas nicolas-grekas modified the milestones: next, 4.2 Nov 1, 2018
chalasr pushed a commit to chalasr/symfony that referenced this pull request Dec 28, 2018
nicolas-grekas added a commit that referenced this pull request Jan 3, 2019
…(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)"
chalasr pushed a commit that referenced this pull request Jan 4, 2019
* 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
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.

8 participants