Skip to content

Commit eb1a745

Browse files
committed
chore: change ValidationFailedException invalid value method name
1 parent e4bf263 commit eb1a745

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,7 @@ catch (ValidationFailedException $exception) {
123123
// exception message will always be the first error thrown
124124
$message = $exception->getMessage();
125125
// value that failed validation
126-
$value = $exception->getValue();
126+
$value = $exception->getInvalidValue();
127127
// get access to all errors
128128
// returns a ConstraintViolationList object like in the validate method
129129
$errors = $exception->getViolations();

src/Exception/ValidationFailedException.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,16 +8,16 @@ class ValidationFailedException extends \RuntimeException
88
{
99
public function __construct(
1010
string $message,
11-
private readonly mixed $value,
11+
private readonly mixed $invalidValue,
1212
private readonly ConstraintViolationListInterface $violations,
1313
)
1414
{
1515
parent::__construct($message);
1616
}
1717

18-
public function getValue(): mixed
18+
public function getInvalidValue(): mixed
1919
{
20-
return $this->value;
20+
return $this->invalidValue;
2121
}
2222

2323
public function getViolations(): ConstraintViolationListInterface

0 commit comments

Comments
 (0)