| Conditions | 3 |
| Paths | 3 |
| Total Lines | 14 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 24 | public function validate($value, Constraint $constraint) |
||
| 25 | { |
||
| 26 | if (!($constraint instanceof ServiceExists)) |
||
| 27 | { |
||
| 28 | throw new \LogicException(); |
||
| 29 | } |
||
| 30 | |||
| 31 | if (!$this->container->has("{$constraint->getPrefix()}{$value}")) |
||
| 32 | { |
||
| 33 | $this->context->buildViolation($constraint->getMessage()) |
||
| 34 | ->setParameter('{{ value }}', $value) |
||
| 35 | ->addViolation(); |
||
| 36 | } |
||
| 37 | } |
||
| 38 | } |
||
| 39 |