| Conditions | 2 |
| Paths | 2 |
| Total Lines | 9 |
| Code Lines | 5 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 23 | public function validate($value, Constraint $constraint) { |
||
| 24 | // '0' is invalid, since elsewhere we check it using empty(). |
||
| 25 | /** @var \Drupal\crop\Entity\CropType $value */ |
||
| 26 | if (trim($value->id()) == '0') { |
||
| 27 | $this->context->buildViolation($constraint->message) |
||
| 28 | ->atPath('id') |
||
| 29 | ->addViolation(); |
||
| 30 | } |
||
| 31 | } |
||
| 32 | |||
| 34 |