comparison vendor/symfony/validator/Context/ExecutionContext.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
14 use Symfony\Component\Translation\TranslatorInterface; 14 use Symfony\Component\Translation\TranslatorInterface;
15 use Symfony\Component\Validator\Constraint; 15 use Symfony\Component\Validator\Constraint;
16 use Symfony\Component\Validator\ConstraintViolation; 16 use Symfony\Component\Validator\ConstraintViolation;
17 use Symfony\Component\Validator\ConstraintViolationList; 17 use Symfony\Component\Validator\ConstraintViolationList;
18 use Symfony\Component\Validator\Mapping\ClassMetadataInterface; 18 use Symfony\Component\Validator\Mapping\ClassMetadataInterface;
19 use Symfony\Component\Validator\Mapping\MemberMetadata;
19 use Symfony\Component\Validator\Mapping\MetadataInterface; 20 use Symfony\Component\Validator\Mapping\MetadataInterface;
20 use Symfony\Component\Validator\Mapping\MemberMetadata;
21 use Symfony\Component\Validator\Mapping\PropertyMetadataInterface; 21 use Symfony\Component\Validator\Mapping\PropertyMetadataInterface;
22 use Symfony\Component\Validator\Util\PropertyPath; 22 use Symfony\Component\Validator\Util\PropertyPath;
23 use Symfony\Component\Validator\Validator\ValidatorInterface; 23 use Symfony\Component\Validator\Validator\ValidatorInterface;
24 use Symfony\Component\Validator\Violation\ConstraintViolationBuilder; 24 use Symfony\Component\Validator\Violation\ConstraintViolationBuilder;
25 25
108 /** 108 /**
109 * Stores which objects have been validated in which group. 109 * Stores which objects have been validated in which group.
110 * 110 *
111 * @var array 111 * @var array
112 */ 112 */
113 private $validatedObjects = array(); 113 private $validatedObjects = [];
114 114
115 /** 115 /**
116 * Stores which class constraint has been validated for which object. 116 * Stores which class constraint has been validated for which object.
117 * 117 *
118 * @var array 118 * @var array
119 */ 119 */
120 private $validatedConstraints = array(); 120 private $validatedConstraints = [];
121 121
122 /** 122 /**
123 * Stores which objects have been initialized. 123 * Stores which objects have been initialized.
124 * 124 *
125 * @var array 125 * @var array
177 } 177 }
178 178
179 /** 179 /**
180 * {@inheritdoc} 180 * {@inheritdoc}
181 */ 181 */
182 public function addViolation($message, array $parameters = array()) 182 public function addViolation($message, array $parameters = [])
183 { 183 {
184 $this->violations->add(new ConstraintViolation( 184 $this->violations->add(new ConstraintViolation(
185 $this->translator->trans($message, $parameters, $this->translationDomain), 185 $this->translator->trans($message, $parameters, $this->translationDomain),
186 $message, 186 $message,
187 $parameters, 187 $parameters,
195 } 195 }
196 196
197 /** 197 /**
198 * {@inheritdoc} 198 * {@inheritdoc}
199 */ 199 */
200 public function buildViolation($message, array $parameters = array()) 200 public function buildViolation($message, array $parameters = [])
201 { 201 {
202 return new ConstraintViolationBuilder( 202 return new ConstraintViolationBuilder(
203 $this->violations, 203 $this->violations,
204 $this->constraint, 204 $this->constraint,
205 $message, 205 $message,
301 * {@inheritdoc} 301 * {@inheritdoc}
302 */ 302 */
303 public function markGroupAsValidated($cacheKey, $groupHash) 303 public function markGroupAsValidated($cacheKey, $groupHash)
304 { 304 {
305 if (!isset($this->validatedObjects[$cacheKey])) { 305 if (!isset($this->validatedObjects[$cacheKey])) {
306 $this->validatedObjects[$cacheKey] = array(); 306 $this->validatedObjects[$cacheKey] = [];
307 } 307 }
308 308
309 $this->validatedObjects[$cacheKey][$groupHash] = true; 309 $this->validatedObjects[$cacheKey][$groupHash] = true;
310 } 310 }
311 311