Skip to content

Commit bab0d37

Browse files
Merge branch '6.4' into 7.2
* 6.4: - CS fixes
2 parents 43a2dd6 + fb827b0 commit bab0d37

File tree

4 files changed

+8
-13
lines changed

4 files changed

+8
-13
lines changed

Constraints/ChoiceValidator.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,8 +53,8 @@ public function validate(mixed $value, Constraint $constraint): void
5353
throw new ConstraintDefinitionException('The Choice constraint expects a valid callback.');
5454
}
5555
$choices = $choices();
56-
if (!is_array($choices)) {
57-
throw new ConstraintDefinitionException(sprintf('The Choice constraint callback "%s" is expected to return an array, but returned "%s".', trim($this->formatValue($constraint->callback), '"'), get_debug_type($choices)));
56+
if (!\is_array($choices)) {
57+
throw new ConstraintDefinitionException(\sprintf('The Choice constraint callback "%s" is expected to return an array, but returned "%s".', trim($this->formatValue($constraint->callback), '"'), get_debug_type($choices)));
5858
}
5959
} else {
6060
$choices = $constraint->choices;

Constraints/WeekValidator.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -43,8 +43,8 @@ public function validate(mixed $value, Constraint $constraint): void
4343
return;
4444
}
4545

46-
[$year, $weekNumber] = \explode('-W', $value, 2);
47-
$weeksInYear = (int) \date('W', \mktime(0, 0, 0, 12, 28, $year));
46+
[$year, $weekNumber] = explode('-W', $value, 2);
47+
$weeksInYear = (int) date('W', mktime(0, 0, 0, 12, 28, $year));
4848

4949
if ($weekNumber > $weeksInYear) {
5050
$this->context->buildViolation($constraint->invalidWeekNumberMessage)
@@ -56,7 +56,7 @@ public function validate(mixed $value, Constraint $constraint): void
5656
}
5757

5858
if ($constraint->min) {
59-
[$minYear, $minWeekNumber] = \explode('-W', $constraint->min, 2);
59+
[$minYear, $minWeekNumber] = explode('-W', $constraint->min, 2);
6060
if ($year < $minYear || ($year === $minYear && $weekNumber < $minWeekNumber)) {
6161
$this->context->buildViolation($constraint->tooLowMessage)
6262
->setCode(Week::TOO_LOW_ERROR)
@@ -69,7 +69,7 @@ public function validate(mixed $value, Constraint $constraint): void
6969
}
7070

7171
if ($constraint->max) {
72-
[$maxYear, $maxWeekNumber] = \explode('-W', $constraint->max, 2);
72+
[$maxYear, $maxWeekNumber] = explode('-W', $constraint->max, 2);
7373
if ($year > $maxYear || ($year === $maxYear && $weekNumber > $maxWeekNumber)) {
7474
$this->context->buildViolation($constraint->tooHighMessage)
7575
->setCode(Week::TOO_HIGH_ERROR)

Tests/Constraints/LocaleValidatorTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ public function testTooLongLocale()
101101
$this->validator->validate($locale, $constraint);
102102

103103
$this->buildViolation('myMessage')
104-
->setParameter('{{ value }}', '"' . $locale . '"')
104+
->setParameter('{{ value }}', '"'.$locale.'"')
105105
->setCode(Locale::NO_SUCH_LOCALE_ERROR)
106106
->assertRaised();
107107
}

Tests/Mapping/Loader/FilesLoaderTest.php

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -36,11 +36,6 @@ public function testCallsActualFileLoaderForMetadata()
3636

3737
public function getFilesLoader(LoaderInterface $loader)
3838
{
39-
return new class([
40-
__DIR__.'/constraint-mapping.xml',
41-
__DIR__.'/constraint-mapping.yaml',
42-
__DIR__.'/constraint-mapping.test',
43-
__DIR__.'/constraint-mapping.txt',
44-
], $loader) extends FilesLoader {};
39+
return new class([__DIR__.'/constraint-mapping.xml', __DIR__.'/constraint-mapping.yaml', __DIR__.'/constraint-mapping.test', __DIR__.'/constraint-mapping.txt'], $loader) extends FilesLoader {};
4540
}
4641
}

0 commit comments

Comments
 (0)