tetranz / select2entity-bundle

A Symfony2 bundle that integrates Select2 as a drop-in replacement for a standard entity field on a Symfony form.
MIT License
219 stars 110 forks source link

Symfony 7.0 DataTransformerInterface typing support DataTransformers #192

Open BrunoKingbee opened 11 months ago

BrunoKingbee commented 11 months ago

Recently upgraded to symfony 7.0 with this package installed and noticed the error: Compile Error: Declaration of Tetranz\Select2EntityBundle\Form\DataTransformer\EntitiesToPropertyTransformer::transform($value) must be compatible with Symfony\Component\Form\DataTransformerInterface::transform(mixed $value): mixed

This interface expects native types in the params and return types of this class.

Ghjoost commented 7 months ago

You should type public function getConfigTreeBuilder(): TreeBuilder {...} too ( Tetranz\Select2EntityBundle\DependencyInjection\Configuration )