Converts the violation into a string for debugging purposes.
string The violation as string.
public function __toString() {
$class = (string) (is_object($this->root) ? get_class($this->root) : $this->root);
$propertyPath = (string) $this->propertyPath;
$code = $this->code;
if ('' !== $propertyPath && '[' !== $propertyPath[0] && '' !== $class) {
$class .= '.';
}
if (!empty($code)) {
$code = ' (code ' . $code . ')';
}
return $class . $propertyPath . ":\n " . $this
->getMessage() . $code;
}