Skip to content

Commit 842a399

Browse files
minor symfony#57988 [Validator]  change default Week constraint messages (xabbuh)
This PR was merged into the 7.2 branch. Discussion ---------- [Validator]  change default Week constraint messages | Q | A | ------------- | --- | Branch? | 7.2 | Bug fix? | no | New feature? | no | Deprecations? | no | Issues | see symfony#57987 (comment) | License | MIT Commits ------- 7b9f7fe change default Week constraint messages
2 parents fa91b88 + 7b9f7fe commit 842a399

File tree

1 file changed

+5
-5
lines changed
  • src/Symfony/Component/Validator/Constraints

1 file changed

+5
-5
lines changed

src/Symfony/Component/Validator/Constraints/Week.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -38,9 +38,9 @@ public function __construct(
3838
public ?string $min = null,
3939
public ?string $max = null,
4040
public string $invalidFormatMessage = 'This value does not represent a valid week in the ISO 8601 format.',
41-
public string $invalidWeekNumberMessage = 'The week "{{ value }}" is not a valid week.',
42-
public string $tooLowMessage = 'The value should not be before week "{{ min }}".',
43-
public string $tooHighMessage = 'The value should not be after week "{{ max }}".',
41+
public string $invalidWeekNumberMessage = 'This value is not a valid week.',
42+
public string $tooLowMessage = 'This value should not be before week "{{ min }}".',
43+
public string $tooHighMessage = 'This value should not be after week "{{ max }}".',
4444
?array $groups = null,
4545
mixed $payload = null,
4646
) {
@@ -55,8 +55,8 @@ public function __construct(
5555
}
5656

5757
if (null !== $min && null !== $max) {
58-
[$minYear, $minWeekNumber] = \explode('-W', $min, 2);
59-
[$maxYear, $maxWeekNumber] = \explode('-W', $max, 2);
58+
[$minYear, $minWeekNumber] = explode('-W', $min, 2);
59+
[$maxYear, $maxWeekNumber] = explode('-W', $max, 2);
6060

6161
if ($minYear > $maxYear || ($minYear === $maxYear && $minWeekNumber > $maxWeekNumber)) {
6262
throw new ConstraintDefinitionException(\sprintf('The "%s" constraint requires the min week to be less than or equal to the max week.', __CLASS__));

0 commit comments

Comments
 (0)