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 = 1; |
||
34 | |||
35 | /** |
||
36 | * @var ValidatorInterface |
||
37 | */ |
||
38 | private $validator; |
||
39 | |||
40 | /** |
||
41 | * @param ValidatorInterface $validator |
||
42 | */ |
||
43 | 7 | public function __construct(ValidatorInterface $validator) |
|
47 | |||
48 | /** |
||
49 | * @param string $field |
||
50 | * @param Constraint $constraint |
||
51 | * |
||
52 | * @return $this |
||
53 | */ |
||
54 | 3 | public function add($field, Constraint $constraint) |
|
64 | |||
65 | /** |
||
66 | * @param boolean $flag |
||
67 | */ |
||
68 | 1 | public function throwExceptions($flag = true) |
|
72 | |||
73 | /** |
||
74 | * @return array |
||
75 | */ |
||
76 | 2 | public function getViolations() |
|
80 | |||
81 | /** |
||
82 | * {@inheritdoc} |
||
83 | */ |
||
84 | 4 | public function process($item, callable $next) |
|
107 | |||
108 | /** |
||
109 | * {@inheritdoc} |
||
110 | */ |
||
111 | 1 | public function getPriority() |
|
115 | } |
||
116 |