Skip to content

Commit 97b6064

Browse files
minor symfony#53822 [Validator] revert accepting any scalar value (xabbuh)
This PR was merged into the 7.1 branch. Discussion ---------- [Validator] revert accepting any scalar value | Q | A | ------------- | --- | Branch? | 7.1 | Bug fix? | no | New feature? | no | Deprecations? | no | Issues | | License | MIT This change sneaked into the codebase in symfony#52658. Commits ------- 8d27007 revert accepting any scalar value
2 parents 4573f3b + 8d27007 commit 97b6064

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ public function validate($value, Constraint $constraint): void
3535
return;
3636
}
3737

38-
if (!\is_scalar($value) && !$value instanceof \Stringable) {
38+
if (!\is_string($value) && !$value instanceof \Stringable) {
3939
throw new UnexpectedValueException($value, 'string');
4040
}
4141

src/Symfony/Component/Validator/Tests/Constraints/CidrValidatorTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ public function testExpectsStringCompatibleType()
5252
{
5353
$this->expectException(UnexpectedValueException::class);
5454

55-
$this->validator->validate([123456], new Cidr());
55+
$this->validator->validate(123456, new Cidr());
5656
}
5757

5858
/**

0 commit comments

Comments
 (0)