public function ConstraintViolationList::offsetSet

File

drupal/core/vendor/symfony/validator/Symfony/Component/Validator/ConstraintViolationList.php, line 143

Class

ConstraintViolationList
Default implementation of {@ConstraintViolationListInterface}.

Namespace

Symfony\Component\Validator

Code

public function offsetSet($offset, $violation) {
  if (null === $offset) {
    $this
      ->add($violation);
  }
  else {
    $this
      ->set($offset, $violation);
  }
}