v1.2.2
This commit is contained in:
parent
3a25585090
commit
80a2202d6e
18 changed files with 305 additions and 122 deletions
|
|
@ -18,13 +18,16 @@ class ValidationException extends Nette\InvalidStateException
|
|||
public function __construct(
|
||||
?string $message,
|
||||
/** @var list<Message> */
|
||||
private array $messages = [],
|
||||
private readonly array $messages = [],
|
||||
) {
|
||||
parent::__construct($message ?? $messages[0]->toString());
|
||||
}
|
||||
|
||||
|
||||
/** @return list<string> */
|
||||
/**
|
||||
* Returns all validation error messages as formatted strings.
|
||||
* @return list<string>
|
||||
*/
|
||||
public function getMessages(): array
|
||||
{
|
||||
$res = [];
|
||||
|
|
@ -36,7 +39,10 @@ class ValidationException extends Nette\InvalidStateException
|
|||
}
|
||||
|
||||
|
||||
/** @return list<Message> */
|
||||
/**
|
||||
* Returns all validation error messages as Message objects.
|
||||
* @return list<Message>
|
||||
*/
|
||||
public function getMessageObjects(): array
|
||||
{
|
||||
return $this->messages;
|
||||
|
|
|
|||
Loading…
Reference in a new issue