public function validate($value, Constraint $constraint)
{
if ($value !== null) {
$ical = new ICal($value->getPathName());
$events = $ical->events();
if ($events === null || count($events) === 0) {
$this->context->addViolation($constraint->message);
}
}
}