SymfonyCasts / dynamic-forms

Add dynamic/dependent fields to Symfony forms
https://symfonycasts.com
MIT License
98 stars 10 forks source link

Symfonycasts\DynamicForms\DynamicFormBuilder::add is not compatible with Symfony\Component\Form\FormBuilderInterface::add #5

Closed fransweerts closed 1 year ago

fransweerts commented 1 year ago

Hello,

I am using symfony/form version: v5.4.26. Symfonycasts\DynamicForms\DynamicFormBuilder::add is not compatible with Symfony\Component\Form\FormBuilderInterface::add.

The typehint for the parameter $child is not compatible.

Symfony: Compile Error: Declaration of Symfonycasts\DynamicForms\DynamicFormBuilder::add(Symfony\Component\Form\FormBuilderInterface|string $child, ?string $type = null, array $options = []): Symfony\Component\ErrorHandler\DebugClassLoader must be compatible with Symfony\Component\Form\FormBuilderInterface::add($child, ?string $type = null, array $options = [])

bocharsky-bw commented 1 year ago

@fransweerts #6 should fix it, could you please double-check it works for you?

fransweerts commented 1 year ago

@bocharsky-bw There are other methods which have the same issue. I have made a PR: #7

bocharsky-bw commented 1 year ago

Cool, thank you for fixing it on Symfony 5.4