Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 7 additions & 11 deletions src/Maker/MakeRegistrationForm.php
Original file line number Diff line number Diff line change
Expand Up @@ -559,9 +559,7 @@ private function generateFormClass(ClassNameDetails $userClassDetails, Generator
'options_code' => <<<EOF
'mapped' => false,
'constraints' => [
new IsTrue([
'message' => 'You should agree to our terms.',
]),
new IsTrue(message: 'You should agree to our terms.'),
],
EOF
],
Expand All @@ -573,15 +571,13 @@ private function generateFormClass(ClassNameDetails $userClassDetails, Generator
'mapped' => false,
'attr' => ['autocomplete' => 'new-password'],
'constraints' => [
new NotBlank([
'message' => 'Please enter a password',
]),
new Length([
'min' => 6,
'minMessage' => 'Your password should be at least {{ limit }} characters',
new NotBlank(message: 'Please enter a password'),
new Length(
min: 6,
minMessage: 'Your password should be at least {{ limit }} characters',
// max length allowed by Symfony for security reasons
'max' => 4096,
]),
max: 4096
),
],
EOF
],
Expand Down
14 changes: 6 additions & 8 deletions templates/resetPassword/ChangePasswordFormType.tpl.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,15 +18,13 @@ public function buildForm(FormBuilderInterface $builder, array $options): void
],
'first_options' => [
'constraints' => [
new NotBlank([
'message' => 'Please enter a password',
]),
new Length([
'min' => 12,
'minMessage' => 'Your password should be at least {{ limit }} characters',
new NotBlank(message: 'Please enter a password'),
new Length(
min: 12,
minMessage: 'Your password should be at least {{ limit }} characters',
// max length allowed by Symfony for security reasons
'max' => 4096,
]),
max: 4096
),
new PasswordStrength(),
new NotCompromisedPassword(),
],
Expand Down
4 changes: 1 addition & 3 deletions templates/resetPassword/ResetPasswordRequestFormType.tpl.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,7 @@ public function buildForm(FormBuilderInterface $builder, array $options): void
->add('<?= $email_field ?>', EmailType::class, [
'attr' => ['autocomplete' => 'email'],
'constraints' => [
new NotBlank([
'message' => 'Please enter your email',
]),
new NotBlank(message: 'Please enter your email'),
],
])
;
Expand Down
Loading