8000 bug #9722 [Validator]Fixed getting wrong msg when value is an object … · symfony/symfony@c4bf848 · GitHub
[go: up one dir, main page]

Skip to content

Commit c4bf848

Browse files
committed
bug #9722 [Validator]Fixed getting wrong msg when value is an object in Exception (aitboudad)This PR was merged into the 2.3 branch. Discussion ---------- [Validator]Fixed getting wrong msg when value is an object in Exception | Q | A | ------------- | --- | Bug fix? | yes | New feature? | no | BC breaks? | no | Deprecations? | no | Tests pass? | yes | License | MIT Commits ------- cdb5ae0 [Validator]Fixed getting wrong msg when value is an object in UnexpectedTypeException
2 parents d490e5a + cdb5ae0 commit c4bf848

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/Symfony/Component/Validator/Exception/UnexpectedTypeException.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,6 @@ class UnexpectedTypeException extends ValidatorException
1515
{
1616
public function __construct($value, $expectedType)
1717
{
18-
parent::__construct(sprintf('Expected argument of type %s, %s given', $expectedType, gettype($value)));
18+
parent::__construct(sprintf('Expected argument of type "%s", "%s" given', $expectedType, is_object($value) ? get_class($value) : gettype($value)));
1919
}
2020
}

0 commit comments

Comments
 (0)
0