Skip to content

Conversation

@Filoz
Copy link
Contributor

@Filoz Filoz commented Sep 28, 2015

In Symfony 2.7, the setDefaultOptions() method of AbstractType and AbstractExtensionType has been deprecated in favor of the new configureOptions() method

http://symfony.com/blog/new-in-symfony-2-7-form-and-validator-updates

In Symfony 2.7, the setDefaultOptions() method of AbstractType and AbstractExtensionType has been deprecated in favor of the new configureOptions() method
setDefaultOptions is deprecated
setDefaults Is deprecated
Copy link
Owner

Choose a reason for hiding this comment

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

use Symfony\Component\OptionsResolver\OptionsResolver;

needed 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.

You are absolutely right, I forgot to add it;

@hilobok
Copy link
Owner

hilobok commented Sep 28, 2015

also, as this will introduce BC break, I'll consider to increase major version number

@Filoz
Copy link
Contributor Author

Filoz commented Sep 28, 2015

probably the best solution to mantain the bundle compatible with Symfony version lower to 2.7 can be the this: http://stackoverflow.com/a/28671099/3625883

The methods setAllowedValues(), addAllowedValues(), setAllowedTypes() and addAllowedTypes() were changed to modify one option at a time instead of batch processing options. The old API exists for backwards compatibility, but will be removed in Symfony 3.0.

https://github.com/symfony/symfony/blob/2.8/UPGRADE-2.6.md#optionsresolver
@Filoz Filoz changed the title setDefaults Is deprecated remove some deprecated code Sep 29, 2015
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.

2 participants