comparison vendor/symfony/validator/ConstraintViolation.php @ 17:129ea1e6d783

Update, including to Drupal core 8.6.10
author Chris Cannam
date Thu, 28 Feb 2019 13:21:36 +0000
parents 1fec387a4317
children
comparison
equal deleted inserted replaced
16:c2387f117808 17:129ea1e6d783
68 * 68 *
69 * @return string The violation as string 69 * @return string The violation as string
70 */ 70 */
71 public function __toString() 71 public function __toString()
72 { 72 {
73 if (is_object($this->root)) { 73 if (\is_object($this->root)) {
74 $class = 'Object('.get_class($this->root).')'; 74 $class = 'Object('.\get_class($this->root).')';
75 } elseif (is_array($this->root)) { 75 } elseif (\is_array($this->root)) {
76 $class = 'Array'; 76 $class = 'Array';
77 } else { 77 } else {
78 $class = (string) $this->root; 78 $class = (string) $this->root;
79 } 79 }
80 80
81 $propertyPath = (string) $this->propertyPath; 81 $propertyPath = (string) $this->propertyPath;
82 $code = $this->code; 82 $code = (string) $this->code;
83 83
84 if ('' !== $propertyPath && '[' !== $propertyPath[0] && '' !== $class) { 84 if ('' !== $propertyPath && '[' !== $propertyPath[0] && '' !== $class) {
85 $class .= '.'; 85 $class .= '.';
86 } 86 }
87 87
88 if (!empty($code)) { 88 if ('' !== $code) {
89 $code = ' (code '.$code.')'; 89 $code = ' (code '.$code.')';
90 } 90 }
91 91
92 return $class.$propertyPath.":\n ".$this->getMessage().$code; 92 return $class.$propertyPath.":\n ".$this->getMessage().$code;
93 } 93 }