Skip to content

Commit aa37c3c

Browse files
committed
bug #1674 Fix default param key in validator (PierreBaud)
This PR was merged into the 1.x branch. Discussion ---------- Fix default param key in validator Default param key not matching with default validator. Failure it's seem not related to my changes Commits ------- f12982b fix: default validator param message
2 parents f0dbf23 + f12982b commit aa37c3c

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

templates/validator/Constraint.tpl.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
<?= $class_data->getClassDeclaration(); ?>
99

1010
{
11-
public string $message = 'The string "{{ string }}" contains an illegal character: it can only contain letters or numbers.';
11+
public string $message = 'The string "{{ value }}" contains an illegal character: it can only contain letters or numbers.';
1212

1313
// You can use #[HasNamedArguments] to make some constraint options required.
1414
// All configurable options must be passed to the constructor.

tests/fixtures/make-validator/expected/FooBar.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
#[\Attribute(\Attribute::TARGET_PROPERTY | \Attribute::TARGET_METHOD | \Attribute::IS_REPEATABLE)]
88
final class FooBar extends Constraint
99
{
10-
public string $message = 'The string "{{ string }}" contains an illegal character: it can only contain letters or numbers.';
10+
public string $message = 'The string "{{ value }}" contains an illegal character: it can only contain letters or numbers.';
1111

1212
// You can use #[HasNamedArguments] to make some constraint options required.
1313
// All configurable options must be passed to the constructor.

0 commit comments

Comments
 (0)