Skip to content

Commit 0946c50

Browse files
Merge branch '6.2' into 6.3
* 6.2: CS fix Fix test provider
2 parents 133797d + 8d7daad commit 0946c50

File tree

6 files changed

+10
-11
lines changed

6 files changed

+10
-11
lines changed

Constraints/Cidr.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ public function __construct(
6666
) {
6767
$this->version = $version ?? $options['version'] ?? $this->version;
6868

69-
if (!array_key_exists($this->version, self::NET_MAXES)) {
69+
if (!\array_key_exists($this->version, self::NET_MAXES)) {
7070
throw new ConstraintDefinitionException(sprintf('The option "version" must be one of "%s".', implode('", "', array_keys(self::NET_MAXES))));
7171
}
7272

Constraints/NotCompromisedPasswordValidator.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,9 +50,9 @@ public function __construct(HttpClientInterface $httpClient = null, string $char
5050
}
5151

5252
/**
53-
* @throws ExceptionInterface
54-
*
5553
* @return void
54+
*
55+
* @throws ExceptionInterface
5656
*/
5757
public function validate(mixed $value, Constraint $constraint)
5858
{

Mapping/ClassMetadata.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -425,9 +425,9 @@ public function getReflectionClass(): \ReflectionClass
425425
/**
426426
* Sets whether a group sequence provider should be used.
427427
*
428-
* @throws GroupDefinitionException
429-
*
430428
* @return void
429+
*
430+
* @throws GroupDefinitionException
431431
*/
432432
public function setGroupSequenceProvider(bool $active)
433433
{

Tests/Constraints/FileValidatorTestCase.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -501,7 +501,7 @@ public static function uploadedFileErrorProvider()
501501
], '1'];
502502

503503
// access FileValidator::factorizeSizes() private method to format max file size
504-
$reflection = new \ReflectionClass((new FileValidator()));
504+
$reflection = new \ReflectionClass(new FileValidator());
505505
$method = $reflection->getMethod('factorizeSizes');
506506
[, $limit, $suffix] = $method->invokeArgs(new FileValidator(), [0, UploadedFile::getMaxFilesize(), false]);
507507

Tests/Constraints/RangeTest.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ public function testThrowsConstraintExceptionIfBothMinLimitAndPropertyPathNamed(
3232
{
3333
$this->expectException(\Symfony\Component\Validator\Exception\ConstraintDefinitionException::class);
3434
$this->expectExceptionMessage('requires only one of the "min" or "minPropertyPath" options to be set, not both.');
35-
eval('new \Symfony\Component\Validator\Constraints\Range(min: "min", minPropertyPath: "minPropertyPath");');
35+
new Range(min: 'min', minPropertyPath: 'minPropertyPath');
3636
}
3737

3838
public function testThrowsConstraintExceptionIfBothMaxLimitAndPropertyPath()
@@ -49,7 +49,7 @@ public function testThrowsConstraintExceptionIfBothMaxLimitAndPropertyPathNamed(
4949
{
5050
$this->expectException(\Symfony\Component\Validator\Exception\ConstraintDefinitionException::class);
5151
$this->expectExceptionMessage('requires only one of the "max" or "maxPropertyPath" options to be set, not both.');
52-
eval('new \Symfony\Component\Validator\Constraints\Range(max: "max", maxPropertyPath: "maxPropertyPath");');
52+
new Range(max: 'max', maxPropertyPath: 'maxPropertyPath');
5353
}
5454

5555
public function testThrowsConstraintExceptionIfNoLimitNorPropertyPath()
@@ -69,6 +69,6 @@ public function testThrowsConstraintDefinitionExceptionIfBothMinAndMaxAndMinMess
6969
{
7070
$this->expectException(\Symfony\Component\Validator\Exception\ConstraintDefinitionException::class);
7171
$this->expectExceptionMessage('can not use "minMessage" and "maxMessage" when the "min" and "max" options are both set. Use "notInRangeMessage" instead.');
72-
eval('new \Symfony\Component\Validator\Constraints\Range(min: "min", max: "max", minMessage: "minMessage", maxMessage: "maxMessage");');
72+
new Range(min: 'min', max: 'max', minMessage: 'minMessage', maxMessage: 'maxMessage');
7373
}
7474
}

Tests/Constraints/UlidValidatorTest.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@
1111

1212
namespace Symfony\Component\Validator\Tests\Constraints;
1313

14-
use stdClass;
1514
use Symfony\Component\Validator\Constraints\Ulid;
1615
use Symfony\Component\Validator\Constraints\UlidValidator;
1716
use Symfony\Component\Validator\Exception\UnexpectedValueException;
@@ -44,7 +43,7 @@ public function testEmptyStringIsValid()
4443
public function testExpectsStringCompatibleType()
4544
{
4645
$this->expectException(UnexpectedValueException::class);
47-
$this->validator->validate(new stdClass(), new Ulid());
46+
$this->validator->validate(new \stdClass(), new Ulid());
4847
}
4948

5049
public function testValidUlid()

0 commit comments

Comments
 (0)