I try to create a custom FormType. I need to use external service and i want to use friendly autowiring of the depedency injection.
...
class HiddenDocumentType extends AbstractType
{
public function __construct(private ManagerRegistry $registry) {}
...
When i use it, i have this error :
Too few arguments to function AppFormTypeHiddenDocumentType::__construct(), 0 passed in /var/www/html/vendor/symfony/form/FormRegistry.php on line 78 and exactly 1 expected
I don’t understand why the “vendor/symfony/form/FormRegistry.php” try to create new instance of class instead of using the depency injection ?
Error stack
Thank’s you
New contributor