1 | <?php |
||
13 | class ValidatorStep implements PriorityStep |
||
14 | { |
||
15 | /** |
||
16 | * @var array |
||
17 | */ |
||
18 | private $constraints = []; |
||
19 | |||
20 | /** |
||
21 | * @var array |
||
22 | */ |
||
23 | private $violations = []; |
||
24 | |||
25 | /** |
||
26 | * @var boolean |
||
27 | */ |
||
28 | private $throwExceptions = false; |
||
29 | |||
30 | /** |
||
31 | * @var integer |
||
32 | */ |
||
33 | private $line = 0; |
||
34 | |||
35 | /** |
||
36 | * @var ValidatorInterface |
||
37 | */ |
||
38 | private $validator; |
||
39 | |||
40 | /** |
||
41 | * @param ValidatorInterface $validator |
||
42 | */ |
||
43 | 10 | public function __construct(ValidatorInterface $validator) |
|
47 | |||
48 | /** |
||
49 | * @param string $field |
||
50 | * @param Constraint $constraint |
||
51 | * |
||
52 | * @return $this |
||
53 | */ |
||
54 | 5 | public function add($field, Constraint $constraint) |
|
64 | |||
65 | /** |
||
66 | * @param boolean $flag |
||
67 | */ |
||
68 | 2 | public function throwExceptions($flag = true) |
|
72 | |||
73 | /** |
||
74 | * @return array |
||
75 | */ |
||
76 | 4 | public function getViolations() |
|
80 | |||
81 | /** |
||
82 | * Add additional options to the Collection constraint. |
||
83 | * |
||
84 | * @param string $option |
||
85 | * @param mixed $optionValue |
||
86 | * |
||
87 | * @return $this |
||
88 | */ |
||
89 | 1 | public function addOption($option, $optionValue) |
|
95 | |||
96 | /** |
||
97 | * {@inheritdoc} |
||
98 | */ |
||
99 | 7 | public function process($item, callable $next) |
|
122 | |||
123 | /** |
||
124 | * {@inheritdoc} |
||
125 | */ |
||
126 | 1 | public function getPriority() |
|
130 | } |
||
131 |