message = $message; $this->messageTemplate = $messageTemplate; $this->parameters = $parameters; $this->plural = $plural; $this->root = $root; $this->propertyPath = $propertyPath; $this->invalidValue = $invalidValue; $this->constraint = $constraint; $this->code = $code; $this->cause = $cause; } public function __toString() { if (\is_object($this->root)) { $class = 'Object(' . \get_class($this->root) . ')'; } elseif (\is_array($this->root)) { $class = 'Array'; } else { $class = (string) $this->root; } $propertyPath = (string) $this->propertyPath; if ('' !== $propertyPath && '[' !== $propertyPath[0] && '' !== $class) { $class .= '.'; } if (null !== ($code = $this->code) && '' !== $code) { $code = ' (code ' . $code . ')'; } return $class . $propertyPath . ":\n " . $this->getMessage() . $code; } public function getMessageTemplate() { return (string) $this->messageTemplate; } public function getParameters() { return $this->parameters; } public function getPlural() { return $this->plural; } public function getMessage() { return $this->message; } public function getRoot() { return $this->root; } public function getPropertyPath() { return (string) $this->propertyPath; } public function getInvalidValue() { return $this->invalidValue; } public function getConstraint() { return $this->constraint; } public function getCause() { return $this->cause; } public function getCode() { return $this->code; } }