Mercurial > hg > cmmr2012-drupal-site
comparison vendor/symfony/validator/Validator/TraceableValidator.php @ 4:a9cd425dd02b
Update, including to Drupal core 8.6.10
author | Chris Cannam |
---|---|
date | Thu, 28 Feb 2019 13:11:55 +0000 |
parents | c75dbcec494b |
children |
comparison
equal
deleted
inserted
replaced
3:307d7a7fd348 | 4:a9cd425dd02b |
---|---|
19 * @author Maxime Steinhausser <maxime.steinhausser@gmail.com> | 19 * @author Maxime Steinhausser <maxime.steinhausser@gmail.com> |
20 */ | 20 */ |
21 class TraceableValidator implements ValidatorInterface | 21 class TraceableValidator implements ValidatorInterface |
22 { | 22 { |
23 private $validator; | 23 private $validator; |
24 private $collectedData = array(); | 24 private $collectedData = []; |
25 | 25 |
26 public function __construct(ValidatorInterface $validator) | 26 public function __construct(ValidatorInterface $validator) |
27 { | 27 { |
28 $this->validator = $validator; | 28 $this->validator = $validator; |
29 } | 29 } |
36 return $this->collectedData; | 36 return $this->collectedData; |
37 } | 37 } |
38 | 38 |
39 public function reset() | 39 public function reset() |
40 { | 40 { |
41 $this->collectedData = array(); | 41 $this->collectedData = []; |
42 } | 42 } |
43 | 43 |
44 /** | 44 /** |
45 * {@inheritdoc} | 45 * {@inheritdoc} |
46 */ | 46 */ |
90 } | 90 } |
91 | 91 |
92 $name = str_replace('\\', '/', $file); | 92 $name = str_replace('\\', '/', $file); |
93 $name = substr($name, strrpos($name, '/') + 1); | 93 $name = substr($name, strrpos($name, '/') + 1); |
94 | 94 |
95 $this->collectedData[] = array( | 95 $this->collectedData[] = [ |
96 'caller' => compact('name', 'file', 'line'), | 96 'caller' => compact('name', 'file', 'line'), |
97 'context' => compact('value', 'constraints', 'groups'), | 97 'context' => compact('value', 'constraints', 'groups'), |
98 'violations' => iterator_to_array($violations), | 98 'violations' => iterator_to_array($violations), |
99 ); | 99 ]; |
100 | 100 |
101 return $violations; | 101 return $violations; |
102 } | 102 } |
103 | 103 |
104 /** | 104 /** |