Exceptions
InvalidArgumentException
HTTP 500 Internal Server Error
Stack Trace
in
vendor/symfony/validator/Constraints/IsTrue.php
(line 39)
* @param string[]|null $groups */public function __construct(?array $options = null, ?string $message = null, ?array $groups = null, mixed $payload = null){ if (null !== $options) { throw new InvalidArgumentException(\sprintf('Passing an array of options to configure the "%s" constraint is no longer supported.', static::class)); } parent::__construct(null, $groups, $payload); $this->message = $message ?? $this->message;
IsTrue->__construct(array('message' => 'You should agree to our terms.'))
in
src/Form/RegistrationFormType.php
(line 24)
$builder ->add('email') ->add('agreeTerms', CheckboxType::class, [ 'mapped' => false, 'constraints' => [ new IsTrue([ 'message' => 'You should agree to our terms.', ]), ], ]) ->add('plainPassword', PasswordType::class, [
RegistrationFormType->buildForm(FormBuilder, array('block_name' => null, 'disabled' => false, 'label' => null, 'label_format' => null, 'label_translation_parameters' => array(), 'attr_translation_parameters' => array(), 'translation_domain' => null, 'auto_initialize' => true, 'trim' => true, 'required' => true, 'property_path' => null, 'mapped' => true, 'by_reference' => true, 'inherit_data' => false, 'compound' => true, 'method' => 'POST', 'post_max_size_message' => 'The uploaded file was too large. Please try to upload a smaller file.', 'allow_file_upload' => false, 'allow_array_submission' => false, 'help_translation_parameters' => array(), 'invalid_message' => 'This value is not valid.', 'invalid_message_parameters' => array(), 'error_mapping' => array(), 'allow_extra_fields' => false, 'extra_fields_message' => 'This form should not contain extra fields.', 'block_prefix' => null, 'row_attr' => array(), 'label_html' => false, 'attr' => array(), 'priority' => 0, 'form_attr' => false, 'data_class' => 'App\\Entity\\User', 'empty_data' => Closure, 'error_bubbling' => true, 'label_attr' => array(), 'action' => '', 'upload_max_size_message' => Closure, 'help' => null, 'help_attr' => array(), 'help_html' => false, 'is_empty_callback' => null, 'getter' => null, 'setter' => null, 'validation_groups' => null, 'constraints' => array(), 'csrf_protection' => true, 'csrf_field_name' => '_token', 'csrf_message' => 'The CSRF token is invalid. Please try to resubmit the form.', 'csrf_token_manager' => SameOriginCsrfTokenManager, 'csrf_token_id' => null, 'data' => User))
in
vendor/symfony/form/ResolvedFormType.php
(line 100)
public function buildForm(FormBuilderInterface $builder, array $options): void{ $this->parent?->buildForm($builder, $options); $this->innerType->buildForm($builder, $options); foreach ($this->typeExtensions as $extension) { $extension->buildForm($builder, $options); }}
ResolvedFormType->buildForm(FormBuilder, array('block_name' => null, 'disabled' => false, 'label' => null, 'label_format' => null, 'label_translation_parameters' => array(), 'attr_translation_parameters' => array(), 'translation_domain' => null, 'auto_initialize' => true, 'trim' => true, 'required' => true, 'property_path' => null, 'mapped' => true, 'by_reference' => true, 'inherit_data' => false, 'compound' => true, 'method' => 'POST', 'post_max_size_message' => 'The uploaded file was too large. Please try to upload a smaller file.', 'allow_file_upload' => false, 'allow_array_submission' => false, 'help_translation_parameters' => array(), 'invalid_message' => 'This value is not valid.', 'invalid_message_parameters' => array(), 'error_mapping' => array(), 'allow_extra_fields' => false, 'extra_fields_message' => 'This form should not contain extra fields.', 'block_prefix' => null, 'row_attr' => array(), 'label_html' => false, 'attr' => array(), 'priority' => 0, 'form_attr' => false, 'data_class' => 'App\\Entity\\User', 'empty_data' => Closure, 'error_bubbling' => true, 'label_attr' => array(), 'action' => '', 'upload_max_size_message' => Closure, 'help' => null, 'help_attr' => array(), 'help_html' => false, 'is_empty_callback' => null, 'getter' => null, 'setter' => null, 'validation_groups' => null, 'constraints' => array(), 'csrf_protection' => true, 'csrf_field_name' => '_token', 'csrf_message' => 'The CSRF token is invalid. Please try to resubmit the form.', 'csrf_token_manager' => SameOriginCsrfTokenManager, 'csrf_token_id' => null, 'data' => User))
in
vendor/symfony/form/Extension/DataCollector/Proxy/ResolvedTypeDataCollectorProxy.php
(line 73)
return $this->proxiedType->createView($form, $parent);}public function buildForm(FormBuilderInterface $builder, array $options): void{ $this->proxiedType->buildForm($builder, $options);}public function buildView(FormView $view, FormInterface $form, array $options): void{ $this->proxiedType->buildView($view, $form, $options);
ResolvedTypeDataCollectorProxy->buildForm(FormBuilder, array('block_name' => null, 'disabled' => false, 'label' => null, 'label_format' => null, 'label_translation_parameters' => array(), 'attr_translation_parameters' => array(), 'translation_domain' => null, 'auto_initialize' => true, 'trim' => true, 'required' => true, 'property_path' => null, 'mapped' => true, 'by_reference' => true, 'inherit_data' => false, 'compound' => true, 'method' => 'POST', 'post_max_size_message' => 'The uploaded file was too large. Please try to upload a smaller file.', 'allow_file_upload' => false, 'allow_array_submission' => false, 'help_translation_parameters' => array(), 'invalid_message' => 'This value is not valid.', 'invalid_message_parameters' => array(), 'error_mapping' => array(), 'allow_extra_fields' => false, 'extra_fields_message' => 'This form should not contain extra fields.', 'block_prefix' => null, 'row_attr' => array(), 'label_html' => false, 'attr' => array(), 'priority' => 0, 'form_attr' => false, 'data_class' => 'App\\Entity\\User', 'empty_data' => Closure, 'error_bubbling' => true, 'label_attr' => array(), 'action' => '', 'upload_max_size_message' => Closure, 'help' => null, 'help_attr' => array(), 'help_html' => false, 'is_empty_callback' => null, 'getter' => null, 'setter' => null, 'validation_groups' => null, 'constraints' => array(), 'csrf_protection' => true, 'csrf_field_name' => '_token', 'csrf_message' => 'The CSRF token is invalid. Please try to resubmit the form.', 'csrf_token_manager' => SameOriginCsrfTokenManager, 'csrf_token_id' => null, 'data' => User))
in
vendor/symfony/form/FormFactory.php
(line 85)
$builder->setInitialOptions($options); } // Explicitly call buildForm() in order to be able to override either // createBuilder() or buildForm() in the resolved form type $type->buildForm($builder, $builder->getOptions()); return $builder;}public function createBuilderForProperty(string $class, string $property, mixed $data = null, array $options = []): FormBuilderInterface
FormFactory->createNamedBuilder('registration_form', ResolvedTypeDataCollectorProxy, User, array('data' => User))
in
vendor/symfony/form/FormFactory.php
(line 63)
/** * @return ($type is class-string<FormFlowTypeInterface> ? FormFlowBuilderInterface : FormBuilderInterface) */public function createBuilder(string $type = FormType::class, mixed $data = null, array $options = []): FormBuilderInterface{ return $this->createNamedBuilder($this->registry->getType($type)->getBlockPrefix(), $type, $data, $options);}/** * @return ($type is class-string<FormFlowTypeInterface> ? FormFlowBuilderInterface : FormBuilderInterface) */
FormFactory->createBuilder('App\\Form\\RegistrationFormType', User, array())
in
vendor/symfony/form/FormFactory.php
(line 42)
/** * @return ($type is class-string<FormFlowTypeInterface> ? FormFlowInterface : FormInterface) */public function create(string $type = FormType::class, mixed $data = null, array $options = []): FormInterface{ return $this->createBuilder($type, $data, $options)->getForm();}/** * @return ($type is class-string<FormFlowTypeInterface> ? FormFlowInterface : FormInterface) */
FormFactory->create('App\\Form\\RegistrationFormType', User, array())
in
vendor/symfony/framework-bundle/Controller/AbstractController.php
(line 356)
* * @return ($type is class-string<FormFlowTypeInterface> ? FormFlowInterface : FormInterface) */protected function createForm(string $type, mixed $data = null, array $options = []): FormInterface{ return $this->container->get('form.factory')->create($type, $data, $options);}/** * Creates and returns a form builder instance. */
AbstractController->createForm('App\\Form\\RegistrationFormType', User)
in
src/Controller/RegistrationController.php
(line 34)
#[Route('/creer-un-compte', name: 'app_register')]public function register(Request $request, UserPasswordHasherInterface $userPasswordHasher, UserAuthenticatorInterface $userAuthenticator, LoginAuthenticator $authenticator, EntityManagerInterface $entityManager): Response{ $user = new User(); $form = $this->createForm(RegistrationFormType::class, $user); $form->handleRequest($request); if ($form->isSubmitted() && $form->isValid()) { // encode the plain password $user->setPassword(
RegistrationController->register(Request, UserPasswordHasher, UserAuthenticator, LoginAuthenticator, EntityManager)
in
vendor/symfony/http-kernel/HttpKernel.php
(line 200)
$this->dispatcher->dispatch($event, KernelEvents::CONTROLLER_ARGUMENTS);$controller = $event->getController();$arguments = $event->getArguments();// call controller$response = $controller(...$arguments);// viewif (!$response instanceof Response) { $event = new ViewEvent($this, $request, $type, $response, $controllerMetadata); $this->dispatcher->dispatch($event, KernelEvents::VIEW);
HttpKernel->handleRaw(Request, 1, ControllerArgumentsMetadata)
in
vendor/symfony/http-kernel/HttpKernel.php
(line 80)
$request->headers->set('X-Php-Ob-Level', (string) ob_get_level());$this->requestStack->push($request);$response = null;try { return $response = $this->handleRaw($request, $type, $controllerMetadata);} catch (\Throwable $e) { if ($e instanceof \Error && !$this->handleAllThrowables) { throw $e; } if (!$this->handlingHttpCache) { $this->resetServices = true; } try { return $this->getHttpKernel()->handle($request, $type, $catch); } finally { --$this->requestStackSize; }}) {}public function run(): int{ $response = $this->kernel->handle($this->request); $response->send(false); if (\function_exists('fastcgi_finish_request') && !$this->debug) { fastcgi_finish_request();$app = $app(...$args);exit( $runtime ->getRunner($app) ->run());<?phpuse App\Kernel;require_once dirname(__DIR__).'/vendor/autoload_runtime.php';return function (array $context) { return new Kernel($context['APP_ENV'], (bool) $context['APP_DEBUG']);};
Symfony\Component\Validator\Exception\InvalidArgumentException:
Passing an array of options to configure the "Symfony\Component\Validator\Constraints\IsTrue" constraint is no longer supported.
at vendor/symfony/validator/Constraints/IsTrue.php:39
at Symfony\Component\Validator\Constraints\IsTrue->__construct(array('message' => 'You should agree to our terms.'))
(src/Form/RegistrationFormType.php:24)
at App\Form\RegistrationFormType->buildForm(object(FormBuilder), array('block_name' => null, 'disabled' => false, 'label' => null, 'label_format' => null, 'label_translation_parameters' => array(), 'attr_translation_parameters' => array(), 'translation_domain' => null, 'auto_initialize' => true, 'trim' => true, 'required' => true, 'property_path' => null, 'mapped' => true, 'by_reference' => true, 'inherit_data' => false, 'compound' => true, 'method' => 'POST', 'post_max_size_message' => 'The uploaded file was too large. Please try to upload a smaller file.', 'allow_file_upload' => false, 'allow_array_submission' => false, 'help_translation_parameters' => array(), 'invalid_message' => 'This value is not valid.', 'invalid_message_parameters' => array(), 'error_mapping' => array(), 'allow_extra_fields' => false, 'extra_fields_message' => 'This form should not contain extra fields.', 'block_prefix' => null, 'row_attr' => array(), 'label_html' => false, 'attr' => array(), 'priority' => 0, 'form_attr' => false, 'data_class' => 'App\\Entity\\User', 'empty_data' => object(Closure), 'error_bubbling' => true, 'label_attr' => array(), 'action' => '', 'upload_max_size_message' => object(Closure), 'help' => null, 'help_attr' => array(), 'help_html' => false, 'is_empty_callback' => null, 'getter' => null, 'setter' => null, 'validation_groups' => null, 'constraints' => array(), 'csrf_protection' => true, 'csrf_field_name' => '_token', 'csrf_message' => 'The CSRF token is invalid. Please try to resubmit the form.', 'csrf_token_manager' => object(SameOriginCsrfTokenManager), 'csrf_token_id' => null, 'data' => object(User)))
(vendor/symfony/form/ResolvedFormType.php:100)
at Symfony\Component\Form\ResolvedFormType->buildForm(object(FormBuilder), array('block_name' => null, 'disabled' => false, 'label' => null, 'label_format' => null, 'label_translation_parameters' => array(), 'attr_translation_parameters' => array(), 'translation_domain' => null, 'auto_initialize' => true, 'trim' => true, 'required' => true, 'property_path' => null, 'mapped' => true, 'by_reference' => true, 'inherit_data' => false, 'compound' => true, 'method' => 'POST', 'post_max_size_message' => 'The uploaded file was too large. Please try to upload a smaller file.', 'allow_file_upload' => false, 'allow_array_submission' => false, 'help_translation_parameters' => array(), 'invalid_message' => 'This value is not valid.', 'invalid_message_parameters' => array(), 'error_mapping' => array(), 'allow_extra_fields' => false, 'extra_fields_message' => 'This form should not contain extra fields.', 'block_prefix' => null, 'row_attr' => array(), 'label_html' => false, 'attr' => array(), 'priority' => 0, 'form_attr' => false, 'data_class' => 'App\\Entity\\User', 'empty_data' => object(Closure), 'error_bubbling' => true, 'label_attr' => array(), 'action' => '', 'upload_max_size_message' => object(Closure), 'help' => null, 'help_attr' => array(), 'help_html' => false, 'is_empty_callback' => null, 'getter' => null, 'setter' => null, 'validation_groups' => null, 'constraints' => array(), 'csrf_protection' => true, 'csrf_field_name' => '_token', 'csrf_message' => 'The CSRF token is invalid. Please try to resubmit the form.', 'csrf_token_manager' => object(SameOriginCsrfTokenManager), 'csrf_token_id' => null, 'data' => object(User)))
(vendor/symfony/form/Extension/DataCollector/Proxy/ResolvedTypeDataCollectorProxy.php:73)
at Symfony\Component\Form\Extension\DataCollector\Proxy\ResolvedTypeDataCollectorProxy->buildForm(object(FormBuilder), array('block_name' => null, 'disabled' => false, 'label' => null, 'label_format' => null, 'label_translation_parameters' => array(), 'attr_translation_parameters' => array(), 'translation_domain' => null, 'auto_initialize' => true, 'trim' => true, 'required' => true, 'property_path' => null, 'mapped' => true, 'by_reference' => true, 'inherit_data' => false, 'compound' => true, 'method' => 'POST', 'post_max_size_message' => 'The uploaded file was too large. Please try to upload a smaller file.', 'allow_file_upload' => false, 'allow_array_submission' => false, 'help_translation_parameters' => array(), 'invalid_message' => 'This value is not valid.', 'invalid_message_parameters' => array(), 'error_mapping' => array(), 'allow_extra_fields' => false, 'extra_fields_message' => 'This form should not contain extra fields.', 'block_prefix' => null, 'row_attr' => array(), 'label_html' => false, 'attr' => array(), 'priority' => 0, 'form_attr' => false, 'data_class' => 'App\\Entity\\User', 'empty_data' => object(Closure), 'error_bubbling' => true, 'label_attr' => array(), 'action' => '', 'upload_max_size_message' => object(Closure), 'help' => null, 'help_attr' => array(), 'help_html' => false, 'is_empty_callback' => null, 'getter' => null, 'setter' => null, 'validation_groups' => null, 'constraints' => array(), 'csrf_protection' => true, 'csrf_field_name' => '_token', 'csrf_message' => 'The CSRF token is invalid. Please try to resubmit the form.', 'csrf_token_manager' => object(SameOriginCsrfTokenManager), 'csrf_token_id' => null, 'data' => object(User)))
(vendor/symfony/form/FormFactory.php:85)
at Symfony\Component\Form\FormFactory->createNamedBuilder('registration_form', object(ResolvedTypeDataCollectorProxy), object(User), array('data' => object(User)))
(vendor/symfony/form/FormFactory.php:63)
at Symfony\Component\Form\FormFactory->createBuilder('App\\Form\\RegistrationFormType', object(User), array())
(vendor/symfony/form/FormFactory.php:42)
at Symfony\Component\Form\FormFactory->create('App\\Form\\RegistrationFormType', object(User), array())
(vendor/symfony/framework-bundle/Controller/AbstractController.php:356)
at Symfony\Bundle\FrameworkBundle\Controller\AbstractController->createForm('App\\Form\\RegistrationFormType', object(User))
(src/Controller/RegistrationController.php:34)
at App\Controller\RegistrationController->register(object(Request), object(UserPasswordHasher), object(UserAuthenticator), object(LoginAuthenticator), object(EntityManager))
(vendor/symfony/http-kernel/HttpKernel.php:200)
at Symfony\Component\HttpKernel\HttpKernel->handleRaw(object(Request), 1, object(ControllerArgumentsMetadata))
(vendor/symfony/http-kernel/HttpKernel.php:80)
at Symfony\Component\HttpKernel\HttpKernel->handle(object(Request), 1, true)
(vendor/symfony/http-kernel/Kernel.php:156)
at Symfony\Component\HttpKernel\Kernel->handle(object(Request))
(vendor/symfony/runtime/Runner/Symfony/HttpKernelRunner.php:34)
at Symfony\Component\Runtime\Runner\Symfony\HttpKernelRunner->run()
(vendor/autoload_runtime.php:32)
at require_once('/var/www/html/vendor/autoload_runtime.php')
(public/index.php:5)