4 * This file is part of the Symfony package.
6 * (c) Fabien Potencier <fabien@symfony.com>
8 * For the full copyright and license information, please view the LICENSE
9 * file that was distributed with this source code.
12 namespace Symfony\Component\Validator;
15 * A list of constraint violations.
17 * @author Bernhard Schussek <bschussek@gmail.com>
19 interface ConstraintViolationListInterface extends \Traversable, \Countable, \ArrayAccess
22 * Adds a constraint violation to this list.
24 public function add(ConstraintViolationInterface $violation);
27 * Merges an existing violation list into this list.
29 public function addAll(ConstraintViolationListInterface $otherList);
32 * Returns the violation at a given offset.
34 * @param int $offset The offset of the violation
36 * @return ConstraintViolationInterface The violation
38 * @throws \OutOfBoundsException if the offset does not exist
40 public function get($offset);
43 * Returns whether the given offset exists.
45 * @param int $offset The violation offset
47 * @return bool Whether the offset exists
49 public function has($offset);
52 * Sets a violation at a given offset.
54 * @param int $offset The violation offset
55 * @param ConstraintViolationInterface $violation The violation
57 public function set($offset, ConstraintViolationInterface $violation);
60 * Removes a violation at a given offset.
62 * @param int $offset The offset to remove
64 public function remove($offset);