Symfony 4.2 deprecation warning (not implementing the static getExtendedTypes() method)
After upgrading to Symfony 4.2 the following deprecation warning is thrown which seems to be related to this bundle:
Not implementing the static getExtendedTypes() method in %lexik_form_filter.type_extension.filter_extension.class% when implementing the Symfony\Component\Form\FormTypeExtensionInterface is deprecated since Symfony 4.2. The method will be added to the interface in 5.0.
Additional information is available here.
Hi,
If you want to contribute you can propose a PR ;)
But one day I will check that issue!
Just implementing a getExtendedTypes() method in Lexik\Bundle\FormFilterBundle\Filter\Form\FilterTypeExtension doesn't remove the deprecation warning, since the lexik_form_filter.type_extension.filter_extension service is still tagged with <tag name="form.type_extension" extended_type="Symfony\Component\Form\Extension\Core\Type\FormType" />. Removing this tag silences the deprecation warning, but will break the service in older symfony-versions I guess. I don't know how to deal with that, but when that can be solved, that would be all.
Sorry, removing the tag from the service definition doesn't work. I removes the deprecated message but afterwards the filter extension doesn't work anymore. So the service must be autoconfigured to work without the tag.
I've been investigating this deprecation and it's closely tied to using parameters as the given class to the service definitions.
I've reported a bug here but I think using proper classes in the service definitions is the way to go, since the bundle is not really taking advantage of them (they're not being exposed in the bundle configuration, for instance).