Conditions | 5 |
Paths | 4 |
Total Lines | 22 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php |
||
15 | public function validate($performance, Constraint $constraint) |
||
16 | { |
||
17 | /* @var $constraint \App\Validator\ProducerConstraint */ |
||
18 | |||
19 | if ($performance->getExtProducer() && $performance->getProducer()) { |
||
20 | $this->context |
||
21 | ->buildViolation($constraint->ambiguousProducer) |
||
22 | ->atPath('producer') |
||
23 | ->addViolation(); |
||
24 | $this->context |
||
25 | ->buildViolation($constraint->ambiguousProducer) |
||
26 | ->atPath('extProducer') |
||
27 | ->addViolation(); |
||
28 | } |
||
29 | |||
30 | if (!$performance->getExtProducer() && !$performance->getProducer()) { |
||
31 | $this->context |
||
32 | ->buildViolation($constraint->noProducer) |
||
33 | ->atPath('producer') |
||
34 | ->addViolation(); |
||
35 | } |
||
36 | } |
||
37 | } |
||
38 |