Skip to content

Commit 54ec693

Browse files
committed
Process Rector rule: ConstraintOptionsToNamedArgumentsRector
Signed-off-by: Tim Goudriaan <tim@codedmonkey.com>
1 parent d886539 commit 54ec693

File tree

2 files changed

+7
-11
lines changed

2 files changed

+7
-11
lines changed

src/Form/NewPasswordType.php

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -50,19 +50,17 @@ public function getParent(): string
5050
public static function constraints(bool $nullable = true): array
5151
{
5252
$constraints = [
53-
new Length([
54-
'min' => 8,
55-
'minMessage' => 'Your password must be at least {{ limit }} characters',
56-
'max' => 4096, // max length allowed by Symfony for security reasons
57-
]),
53+
new Length(
54+
min: 8,
55+
max: 4096,
56+
minMessage: 'Your password must be at least {{ limit }} characters',
57+
),
5858
new PasswordStrength(minScore: PasswordStrength::STRENGTH_WEAK),
5959
new NotCompromisedPassword(),
6060
];
6161

6262
if (!$nullable) {
63-
$constraints[] = new NotBlank([
64-
'message' => 'Enter a password',
65-
]);
63+
$constraints[] = new NotBlank(message: 'Enter a password');
6664
}
6765

6866
return $constraints;

src/Form/ResetPasswordRequestFormType.php

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,7 @@ public function buildForm(FormBuilderInterface $builder, array $options): void
1616
->add('email', TextType::class, [
1717
'attr' => ['autocomplete' => 'email'],
1818
'constraints' => [
19-
new NotBlank([
20-
'message' => 'Enter an email address',
21-
]),
19+
new NotBlank(message: 'Enter an email address'),
2220
],
2321
]);
2422
}

0 commit comments

Comments
 (0)