d96755c9a277e60e7b523fecf3e869d440804190
[yaffs-website] / vendor / symfony / validator / ConstraintViolationListInterface.php
1 <?php
2
3 /*
4  * This file is part of the Symfony package.
5  *
6  * (c) Fabien Potencier <fabien@symfony.com>
7  *
8  * For the full copyright and license information, please view the LICENSE
9  * file that was distributed with this source code.
10  */
11
12 namespace Symfony\Component\Validator;
13
14 /**
15  * A list of constraint violations.
16  *
17  * @author Bernhard Schussek <bschussek@gmail.com>
18  */
19 interface ConstraintViolationListInterface extends \Traversable, \Countable, \ArrayAccess
20 {
21     /**
22      * Adds a constraint violation to this list.
23      *
24      * @param ConstraintViolationInterface $violation The violation to add
25      */
26     public function add(ConstraintViolationInterface $violation);
27
28     /**
29      * Merges an existing violation list into this list.
30      *
31      * @param ConstraintViolationListInterface $otherList The list to merge
32      */
33     public function addAll(ConstraintViolationListInterface $otherList);
34
35     /**
36      * Returns the violation at a given offset.
37      *
38      * @param int $offset The offset of the violation
39      *
40      * @return ConstraintViolationInterface The violation
41      *
42      * @throws \OutOfBoundsException If the offset does not exist.
43      */
44     public function get($offset);
45
46     /**
47      * Returns whether the given offset exists.
48      *
49      * @param int $offset The violation offset
50      *
51      * @return bool Whether the offset exists
52      */
53     public function has($offset);
54
55     /**
56      * Sets a violation at a given offset.
57      *
58      * @param int                          $offset    The violation offset
59      * @param ConstraintViolationInterface $violation The violation
60      */
61     public function set($offset, ConstraintViolationInterface $violation);
62
63     /**
64      * Removes a violation at a given offset.
65      *
66      * @param int $offset The offset to remove
67      */
68     public function remove($offset);
69 }