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

Removed OptionsResolverInterface usage #1

Merged
merged 1 commit into from Oct 9, 2017
Merged

Removed OptionsResolverInterface usage #1

merged 1 commit into from Oct 9, 2017

Conversation

nicosomb
Copy link
Contributor

@nicosomb nicosomb commented Oct 8, 2017

Because OptionsResolverInterface is deprecated, it's now better to use OptionsResolver.

Because [OptionsResolverInterface is deprecated](http://api.symfony.com/3.0/Symfony/Component/OptionsResolver/OptionsResolverInterface.html), it's now better to use `OptionsResolver`.
@j0k3r
Copy link

j0k3r commented Oct 9, 2017

Since there is no test at all on the Form folder, maybe it could a good idea to add some?
With some tests, this error would not have appeared.

@@ -18,7 +17,7 @@ public function configureOptions(OptionsResolver $resolver)
$this->setDefaultOptions($resolver);
}

public function setDefaultOptions(OptionsResolverInterface $resolver)
public function setDefaultOptions(OptionsResolver $resolver)
Copy link
Owner

Choose a reason for hiding this comment

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

Nice catch 👍

Aren't we also supposed to define the configureOptions method instead of setDefaultOptions? (cf: https://symfony.com/doc/2.8/forms.html#creating-form-classes)

Copy link
Owner

Choose a reason for hiding this comment

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

Note to self: it's already defined in the file (and it calls setDefaultOptions).

It's probably done this way to ensure BC for Symfony <2.8. I'll make sure that it's really necessary to maintain compatibility for <2.8 and if not, I'll cleanup the code.

@K-Phoen
Copy link
Owner

K-Phoen commented Oct 9, 2017

You're right, I'll see to add a few tests :)

@K-Phoen
Copy link
Owner

K-Phoen commented Oct 9, 2017

Thanks for the PR 👍

@K-Phoen K-Phoen merged commit f893851 into K-Phoen:master Oct 9, 2017
@nicosomb nicosomb deleted the patch-1 branch October 10, 2017 06:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants