I've got a weird error. I implemented the Form component in my own system. There I created a FormType where I use the EntityType for a field. Everytime i wanna create the form with the formBuilder it throws the following error:
Fatal error: Uncaught ArgumentCountError: Too few arguments to function
Symfony\Bridge\Doctrine\Form\Type\DoctrineType::__construct(), 0 passed in
vendor/symfony/form/FormRegistry.php on line 92 and exactly 1 expected in
vendor/symfony/doctrine-bridge/Form/Type/DoctrineType.php:102
Does anyone here has an idea why this is happening?
Additional information:
composer package versions:
abraham/twitteroauth 0.7.4
doctrine/annotations v1.6.0
doctrine/cache v1.7.1
doctrine/collections v1.5.0
doctrine/common v2.8.1
doctrine/dbal v2.6.3
doctrine/inflector v1.3.0
doctrine/instantiator 1.1.0
doctrine/lexer v1.0.1
doctrine/orm v2.6.1
monolog/monolog 1.23.0
php-curl-class/php-curl-class 8.0.1
phpmailer/phpmailer v6.0.3
psr/cache 1.0.1
psr/log 1.0.2
psr/simple-cache 1.0.0
setasign/fpdf 1.8.1
symfony/cache v4.0.5
symfony/console v4.0.5
symfony/doctrine-bridge v4.0.5
symfony/event-dispatcher v4.0.5
symfony/filesystem v4.0.5
symfony/form v4.0.5
symfony/http-foundation v4.0.5
symfony/inflector v4.0.5
symfony/intl v4.0.5
symfony/options-resolver v4.0.5
symfony/polyfill-intl-icu v1.7.0
symfony/polyfill-mbstring v1.7.0
symfony/polyfill-php72 v1.7.0
symfony/process v4.0.5
symfony/property-access v4.0.5
symfony/security-core v4.0.5
symfony/security-csrf v4.0.5
symfony/translation v4.0.5
symfony/twig-bridge v4.0.5
symfony/validator v4.0.5
symfony/var-dumper v4.0.5
symfony/yaml v4.0.5
twig/extensions v1.5.1
twig/twig v2.4.6
Form Type:
public function buildForm( FormBuilderInterface $builder, array $options )
{
$builder
->add( 'name', TextType::class )
->add( 'image', TextType::class )
->add( 'typeId', IntegerType::class )
->add( 'customFields', EntityType::class, [
'class' => TypeDefinition::class,
'choice_label' => 'name',
'multiple' => true
] )
->add( 'isEnabled', CheckboxType::class )
->add( 'count', IntegerType::class );
}
If you need more information please tell me below :)